Esempio n. 1
0
 def test_exceptions(self, possessive_words):
     for singular, plural in possessive_words:
         assert singularize(plural, language='en') == singular
Esempio n. 2
0
 def test_all_words(self, all_words):
     for singular, plural in all_words:
         assert singularize(plural, language='en') == singular
Esempio n. 3
0
 def test_compound_words(self, compound_words):
     for singular, plural in compound_words:
         assert singularize(plural, language='en') == singular
Esempio n. 4
0
 def test_only_accents(self):
     assert singularize('é') == 'é'
Esempio n. 5
0
 def test_mixed_punctuation_symbol_number(self):
     assert singularize('!.:123$%') == '!.:123$%'
Esempio n. 6
0
 def test_only_numbers(self):
     assert singularize('123') == '123'
Esempio n. 7
0
 def test_only_symbol(self):
     assert singularize('@#$%') == '@#$%'
Esempio n. 8
0
 def test_only_punctuation(self):
     assert singularize('??') == '??'
Esempio n. 9
0
 def test_invalid_language(self):
     with pytest.raises(NotImplementedError):
         singularize('', language='hu')
Esempio n. 10
0
 def test_languages(self):
     assert singularize('nights', language='en') == 'night'
     assert singularize('nuits', language='fr') == 'nuit'