diff options
author | Frederick Muriuki Muriithi | 2022-09-09 06:44:59 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-09-09 06:44:59 +0300 |
commit | f9ce0bc32db3bdd8a5947a18039c557c750f2957 (patch) | |
tree | 4d59941d11700ad9a3e4480dd14152c6ecb8815d /wqflask/tests | |
parent | ff160e5c3dc05e28a98050200b089470c3233e11 (diff) | |
download | genenetwork2-f9ce0bc32db3bdd8a5947a18039c557c750f2957.tar.gz |
Refactor: Add tests and handle edge case
Remove mutation of state, and handle the edge case where the
sub-sequence could be an empty sequence.
Diffstat (limited to 'wqflask/tests')
-rw-r--r-- | wqflask/tests/unit/wqflask/show_trait/test_get_max_digits.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wqflask/tests/unit/wqflask/show_trait/test_get_max_digits.py b/wqflask/tests/unit/wqflask/show_trait/test_get_max_digits.py new file mode 100644 index 00000000..509f6c3a --- /dev/null +++ b/wqflask/tests/unit/wqflask/show_trait/test_get_max_digits.py @@ -0,0 +1,13 @@ +import pytest + +from wqflask.show_trait.show_trait import get_max_digits + +@pytest.mark.parametrize( + "trait_vals,expected", + ((( + (0, 1345, 92, 734), + (234253, 33, 153, 5352), + (3542, 24, 135)), + [3, 5, 3]),)) +def test_get_max_digits(trait_vals, expected): + assert get_max_digits(trait_vals) == expected |