Skip to content

Commit

Permalink
udpated some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww95 committed Dec 3, 2024
1 parent 54642f0 commit 531284c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
(["0.00", "1.0", "3.0"], 'mix'),
(["0.3", 1.0, "4.2"], 'mix'),
([0.00, 1.0, 3.0], 'mix'),
([0.00, 1.1, 3.0], 'mix'),
([0.00, 1, 3.0], 'mix'),
(["0.00", "1", "3.0"], 'mix'),
])
Expand All @@ -30,7 +31,6 @@ def test_guess_format(test_input, expected):
- No base case is handled, function ends with elif statement, the returned value will
then be a '' string, which may not be a handled case
- Are floating point values prevented from entering the function?
- Hashes are still ints depending on the base, e.g. 10, 16 or 64 used to encode the hash
"""
assert expected == utils.guess_format(test_input)

Expand Down Expand Up @@ -236,7 +236,7 @@ def test_guess_profile_format():

def test_get_file_length():
"""
TODO requires setting up temp files
Requires setting up temp files
"""
...

Expand Down Expand Up @@ -335,8 +335,12 @@ def test_get_missing_loci_counts(profiles,labels,count_loci,expected):
- Is count_loci controlled to be the same for every value?
"""
output = utils.get_missing_loci_counts(profiles, labels, count_loci)

#! I am adding a multiplier of 100 to convert the output of the function into a percentage
#! as it seems like this conversion is being handled somewhere else in the program
percent_conversion = 100
for k in labels:
assert pytest.approx(output[k], 0.1) == expected[k]
assert pytest.approx(output[k] * percent_conversion, 0.1) == expected[k]


@pytest.mark.parametrize("missing_counts,threshold,expected", [
Expand Down

0 comments on commit 531284c

Please sign in to comment.