Skip to content

Commit

Permalink
Update unittest for the wers module
Browse files Browse the repository at this point in the history
  • Loading branch information
rossarmstrong committed Nov 29, 2023
1 parent a7107ea commit 78390f0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_wers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ def test_wers_example_4(self):

self.assertEqual(wers(ref, hyp), expected_result)

def test_wers_example_5(self):
"""
Test the wer function with numerical reference and hypothesis inputs.
This test evaluates the WER function with numerical reference and hypothesis inputs.
It verifies that the numerical input will raise an AttributeError.
"""
ref = [1, 2, 3, 4]
hyp = [2, 3, 3, 3]
# The actual return value is None from the try/except block in wer module
expected_result = None

self.assertEqual(wers(ref, hyp), expected_result)


if __name__ == "__main__": # pragma: no cover
unittest.main()

0 comments on commit 78390f0

Please sign in to comment.