From 9bb976b5ca10d1d3924ec6a00778bad012ac8205 Mon Sep 17 00:00:00 2001 From: faissaloux Date: Tue, 28 Nov 2023 13:53:02 +0100 Subject: [PATCH] improve test cov --- tests/max_length_test.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/max_length_test.py b/tests/max_length_test.py index 933ed36..1f8f22a 100644 --- a/tests/max_length_test.py +++ b/tests/max_length_test.py @@ -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"])