From 9f354e1ff36e0cebdfee88b8eca6bb269a43cae4 Mon Sep 17 00:00:00 2001 From: benselme Date: Thu, 8 Jan 2015 17:53:16 -0500 Subject: Extract PluralRule.test and add tests --- tests/test_plural.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_plural.py') diff --git a/tests/test_plural.py b/tests/test_plural.py index 95e2330..49bdfa7 100644 --- a/tests/test_plural.py +++ b/tests/test_plural.py @@ -126,3 +126,20 @@ MALFORMED_TOKEN_TESTS = ( def test_tokenize_malformed(rule_text): with pytest.raises(plural.RuleError): plural.tokenize_rule(rule_text) + + +class TestNextTokenTestCase(unittest.TestCase): + def test_empty(self): + assert not plural.test_next_token([], '') + + def test_type_ok_and_no_value(self): + assert plural.test_next_token([('word', 'and')], 'word') + + def test_type_ok_and_not_value(self): + assert not plural.test_next_token([('word', 'and')], 'word', 'or') + + def test_type_ok_and_value_ok(self): + assert plural.test_next_token([('word', 'and')], 'word', 'and') + + def test_type_not_ok_and_value_ok(self): + assert not plural.test_next_token([('abc', 'and')], 'word', 'and') \ No newline at end of file -- cgit v1.2.1