aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_search.py
diff options
context:
space:
mode:
authorArun Isaac2023-01-24 19:11:49 +0000
committerArun Isaac2023-01-24 19:11:49 +0000
commit9b85f424a37a817641a182da665359b8b2879475 (patch)
tree1189c5de74f4b0ca21ec81461c65c18de30c96ca /tests/unit/test_search.py
parenta9c011099b9e5fcf66dde8f4ceb87ac90838aa7b (diff)
downloadgenenetwork3-9b85f424a37a817641a182da665359b8b2879475.tar.gz
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.
Diffstat (limited to 'tests/unit/test_search.py')
-rw-r--r--tests/unit/test_search.py12
1 files changed, 6 insertions, 6 deletions
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)