def test_empty(self): noun = Noun("") noun.is_singular() noun.is_plural() noun.classical().is_plural() noun.singular() noun.plural() noun.classical().plural()
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()", )
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.", )
def test_classical_repr(self): noun = Noun("brother") classical = noun.classical() self.assertEqual(f"{classical!r}", "Noun('brother').classical()")
def test_classical_modern(self): noun = Noun("brother") classical = noun.classical() modern = classical.modern() self.assertEqual(noun, modern, "Noun(...) = Noun(...).classical().modern()")
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()")