From 11670fac7d722018f515d101088046e1fb5e029c Mon Sep 17 00:00:00 2001 From: DanATW Date: Tue, 2 Nov 2021 17:27:22 +0200 Subject: [PATCH] test(tests): test current state of things --- tests/test_calculators.py | 3 ++- tests/test_linguists.py | 3 ++- tests/test_numberizer.py | 11 ++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/test_calculators.py b/tests/test_calculators.py index edbfe0c..25ccd35 100644 --- a/tests/test_calculators.py +++ b/tests/test_calculators.py @@ -22,7 +22,8 @@ ((20, 5), '25'), ((100, 20, 5), '125'), ((6, 1000000, 600, 5, 1000, 20), '6605020'), - ((1000000, ), '1000000') + ((1000000, ), '1000000'), + ((20, 1000000000), '20000000000') ] diff --git a/tests/test_linguists.py b/tests/test_linguists.py index c87705f..2189746 100644 --- a/tests/test_linguists.py +++ b/tests/test_linguists.py @@ -13,7 +13,8 @@ RU_DATA = [ ("пять", 5), ("five", None), ("ста", 100), ("одного", 1), - ("тысячи", 1000), ("сто", 100), ("п'яти", None), ("дваДцати.", 20) + ("тысячи", 1000), ("сто", 100), ("п'яти", None), ("дваДцати.", 20), + ("миллиардов", 1000000000) ] UK_DATA = [ diff --git a/tests/test_numberizer.py b/tests/test_numberizer.py index ed845bd..5fb01a0 100644 --- a/tests/test_numberizer.py +++ b/tests/test_numberizer.py @@ -10,7 +10,7 @@ ("hundred", '100'), ("hundreds of thousands", "hundreds of thousands"), ("five-nine", "five-nine"), - ("'two miLlion' - that's a number.", "'2000000' - that's a number."), + ("'two million' - that's a number.", "'2000000' - that's a number."), ( """ Note the use of more than one conjunction "and" in large numbers in British @@ -51,6 +51,8 @@ ) ] +RU_DATA = [("20 миллиардов долларов", "20 1000000000 долларов")] + en_numberizer = numberizer.Numberizer('en') ru_numberizer = numberizer.Numberizer('ru') uk_numberizer = numberizer.Numberizer('uk') @@ -63,8 +65,11 @@ def test_replace_numerals_en(text, expected_output): assert ans == exp -# def test_replace_numerals_ru(): -# pass +@pytest.mark.parametrize("text,expected_output", RU_DATA) +def test_replace_numerals_ru(text, expected_output): + ans = ''.join(ru_numberizer.replace_numerals(text).split()) + exp = ''.join(expected_output.split()) + assert ans == exp # def test_replace_numerals_uk():