From 9b85f424a37a817641a182da665359b8b2879475 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 24 Jan 2023 19:11:49 +0000 Subject: tests: Expect exact integer value when applying SI suffix. * tests/unit/test_search.py (test_apply_si_suffix_kilo, test_apply_si_suffix_mega, test_apply_si_suffix_giga): Update docstring indicating that we expect the exact integer value. --- tests/unit/test_search.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/unit/test_search.py b/tests/unit/test_search.py index c535c60..2e8bd5b 100644 --- a/tests/unit/test_search.py +++ b/tests/unit/test_search.py @@ -13,8 +13,8 @@ def test_apply_si_suffix_kilo(mantissa, suffix): GIVEN: A string of a decimal value with up to 9 decimal places and a suffix 'K' e.g. 45.240K - where '45.240' is the decimal values WHEN: We apply the suffix - THEN: We get the integer value that is closest to the decimal value - multiplied by 1000 + THEN: We get an integer value equal to the decimal value multiplied by + 1000 """ assert apply_si_suffix(f"{mantissa}{suffix}") == int(mantissa * 10**3) @@ -26,8 +26,8 @@ def test_apply_si_suffix_mega(mantissa, suffix): GIVEN: A string of a decimal value with up to 9 decimal places and a suffix 'M' e.g. 45.240M - where '45.240' is the decimal values WHEN: We apply the suffix - THEN: We get the integer value that is closest to the decimal value - multiplied by 1000000 + THEN: We get an integer value equal to the decimal value multiplied by + 1000000 """ assert apply_si_suffix(f"{mantissa}{suffix}") == int(mantissa * 10**6) @@ -39,8 +39,8 @@ def test_apply_si_suffix_giga(mantissa, suffix): GIVEN: A string of a decimal value with up to 9 decimal places and a suffix 'G' e.g. 45.240G - where '45.240' is the decimal values WHEN: We apply the suffix - THEN: We get the integer value that is closest to the decimal value - multiplied by 1000000000 + THEN: We get an integer value equal to the decimal value multiplied by + 1000000000 """ assert apply_si_suffix(f"{mantissa}{suffix}") == int(mantissa * 10**9) -- cgit v1.2.3