diff --git a/tests/test_functions.py b/tests/test_functions.py index 958b11335..8af6e8086 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -32,19 +32,18 @@ ("empty list", [], False), ], ) + def test_functions_diff(test_description, given, expected): assert ( functions.diff(given) == expected ), f"{test_description}: Expected {given} to return {expected}" - def test_keep_len_function(): """ Test the len function """ assert functions.len([1, 2, 3]) == 3 - def test_keep_all_function(): """ Test the all function @@ -52,7 +51,6 @@ def test_keep_all_function(): assert functions.all([1, 1, 1]) == True assert functions.all([1, 1, 0]) == False - def test_keep_diff_function(): """ Test the diff function @@ -60,7 +58,6 @@ def test_keep_diff_function(): assert functions.diff([1, 1, 1]) == False assert functions.diff([1, 1, 0]) == True - def test_keep_split_function(): """ Test the split function @@ -68,6 +65,17 @@ def test_keep_split_function(): assert functions.split("a,b,c", ",") == ["a", "b", "c"] assert functions.split("a|b|c", "|") == ["a", "b", "c"] +def test_keep_uppercase_function(): + """ + Test the uppercase function + """ + assert functions.uppercase("a") == "A" + +def test_keep_lowercase_function(): + """ + Test the lowercase function + """ + assert functions.lowercase("A") == "a" def test_keep_strip_function(): """ @@ -75,13 +83,17 @@ def test_keep_strip_function(): """ assert functions.strip(" a ") == "a" - def test_keep_first_function(): """ Test the first function """ assert functions.first([1, 2, 3]) == 1 +def test_keep_last_function(): + """ + Test the last function + """ + assert functions.last([1, 2, 3]) == 3 def test_keep_utcnow_function(): """ @@ -91,7 +103,6 @@ def test_keep_utcnow_function(): assert isinstance(dt.tzinfo, type(datetime.timezone.utc)) assert isinstance(dt, datetime.datetime) - def test_keep_to_utc_function(): """ Test the to_utc function @@ -103,7 +114,6 @@ def test_keep_to_utc_function(): now_utc = functions.to_utc(now) assert now_utc.tzinfo == pytz.utc - def test_keep_datetime_compare_function(): """ Test the datetime_compare function @@ -114,7 +124,6 @@ def test_keep_datetime_compare_function(): assert int(functions.datetime_compare(dt2, dt1)) == 1 assert int(functions.datetime_compare(dt1, dt1)) == 0 - def test_keep_encode_function(): """ Test the encode function