summaryrefslogtreecommitdiff
path: root/tests/test_plural.py
diff options
context:
space:
mode:
authorbenselme <benselme@gmail.com>2015-01-08 17:53:16 -0500
committerbenselme <benselme@gmail.com>2015-01-08 17:53:16 -0500
commit9f354e1ff36e0cebdfee88b8eca6bb269a43cae4 (patch)
treef991540e21fb2223c9136bfd01b40bb8ebdb973a /tests/test_plural.py
parentad2ff1b53a2c5c803b6cbdec08fe9ea1a3865333 (diff)
downloadbabel-9f354e1ff36e0cebdfee88b8eca6bb269a43cae4.tar.gz
Extract PluralRule.test and add tests
Diffstat (limited to 'tests/test_plural.py')
-rw-r--r--tests/test_plural.py17
1 files changed, 17 insertions, 0 deletions
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