Esempio n. 1
0
 def test_empty(self):
     noun = Noun("")
     noun.is_singular()
     noun.is_plural()
     noun.classical().is_plural()
     noun.singular()
     noun.plural()
     noun.classical().plural()
Esempio n. 2
0
 def test_classical_classical(self):
     classical_one = Noun("brother").classical()
     classical_two = classical_one.classical()
     self.assertEqual(
         classical_one,
         classical_two,
         "Noun(...).classical() == Noun(...).classical().classical()",
     )
Esempio n. 3
0
 def test_classical_as_regex(self):
     noun = Noun("brother")
     classical = noun.classical()
     pattern = classical.as_regex()
     self.assertEqual(
         pattern,
         re.compile("brother|brethren", re.IGNORECASE),
         "Check whether as_regex on classical() produces a compiled regex object correctly.",
     )
Esempio n. 4
0
 def test_classical_repr(self):
     noun = Noun("brother")
     classical = noun.classical()
     self.assertEqual(f"{classical!r}", "Noun('brother').classical()")
Esempio n. 5
0
 def test_classical_modern(self):
     noun = Noun("brother")
     classical = noun.classical()
     modern = classical.modern()
     self.assertEqual(noun, modern,
                      "Noun(...) = Noun(...).classical().modern()")
Esempio n. 6
0
 def test_classical_cache(self):
     noun = Noun("brother")
     classical_one = noun.classical()
     classical_two = noun.classical()
     self.assertEqual(classical_one, classical_two,
                      "Cache of Noun(...).classical()")