Skip to content

Commit

Permalink
improve test cov
Browse files Browse the repository at this point in the history
  • Loading branch information
faissaloux committed Nov 28, 2023
1 parent c80b1dc commit 9bb976b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/max_length_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,31 @@ def test_max_length_with_multiple_content_first_elem_less_than_max(self):
assert termspark.center["highlight"][0] == "white"
assert termspark.center["highlight"][1] == "blue"

def test_max_length_with_single_content_first_elem_equal_to_max(self):
termspark = TermSpark()
termspark.spark_center([" CENTER ", "gray", "white"])
termspark.max_center(8)

assert len(termspark.center["content"]) == 1
assert len(termspark.center["color"]) == 1
assert len(termspark.center["highlight"]) == 1
assert termspark.center["content"][0] == " CENTER "
assert termspark.center["color"][0] == "gray"
assert termspark.center["highlight"][0] == "white"

def test_max_length_with_multiple_content_first_elem_equal_to_max(self):
termspark = TermSpark()
termspark.spark_center([" CENTER| ", "gray", "white"])
termspark.spark_center([" RETNER ", "white", "blue"])
termspark.max_center(9)

assert len(termspark.center["content"]) == 1
assert len(termspark.center["color"]) == 1
assert len(termspark.center["highlight"]) == 1
assert termspark.center["content"][0] == " CENTER| "
assert termspark.center["color"][0] == "gray"
assert termspark.center["highlight"][0] == "white"

def test_max_length_minimum_value(self):
termspark = TermSpark()
termspark.spark_center([" CENTER ", "gray", "white"])
Expand Down

0 comments on commit 9bb976b

Please sign in to comment.