Exemplo n.º 1
0
 def test_make_noun_error_proper_no_article(self):
     random.seed(191)
     noun = Noun.proper_noun('Joe')
     definite = [1, 2, 6, 7, 8, 9]
     for index in range(10):
         to_test = make_noun_error(noun)
         if index in definite:
             self.assertEqual(
                 Noun('the Joe', '', 'Joe', tags=self.definite), to_test)
         else:
             self.assertEqual(
                 Noun('a Joe', '', 'Joe', tags=self.indefinite), to_test)
Exemplo n.º 2
0
 def test_make_noun_error_uncountable_definite(self):
     random.seed(10)
     noun = Noun.uncountable_noun('water').definite()
     plural = [1, 2, 5, 6, 7]
     for index in range(10):
         to_test = make_noun_error(noun)
         if index in plural:
             self.assertEqual(
                 Noun('waters', base='water', tags=self.plural), to_test)
         else:
             self.assertEqual(
                 Noun('a water', base='water', tags=self.indefinite),
                 to_test)
Exemplo n.º 3
0
 def test_make_noun_error_plural_proper(self):
     random.seed(69167)
     noun = Noun.proper_noun('Eds', plural=True).capitalize()
     definite = [1, 5, 8, 9]
     for index in range(10):
         to_test = make_noun_error(noun)
         if index in definite:
             self.assertEqual(
                 Noun('the Eds', '', 'Eds', tags=self.definite_plural),
                 to_test)
         else:
             self.assertEqual(
                 Noun('an Eds', '', 'Eds', tags=self.indefinite), to_test)
Exemplo n.º 4
0
 def test_make_noun_error_indefinite(self):
     random.seed(2)
     noun = Noun('toy').indefinite()
     plural = [7, 9, 11]
     indefinite_plural = [13, 14]
     for index in range(15):
         to_test = make_noun_error(noun)
         if index in plural:
             self.assertEqual(Noun('toys', base='toy', tags=self.plural),
                              to_test)
         elif index in indefinite_plural:
             self.assertEqual('a toys', to_test.value)
         else:
             self.assertEqual(Noun('toy'), to_test)
Exemplo n.º 5
0
 def test_make_noun_error_proper_with_article(self):
     random.seed(6541)
     noun = Noun.proper_noun('the Dude').capitalize()
     definite = [0, 1, 2, 7, 8, 9]
     for index in range(10):
         to_test = make_noun_error(noun)
         if index in definite:
             self.assertEqual(
                 Noun('the the Dude', '', 'the Dude', tags=self.definite),
                 to_test)
         else:
             self.assertEqual(
                 Noun('a the Dude', '', 'the Dude', tags=self.indefinite),
                 to_test)
Exemplo n.º 6
0
 def test_make_noun_error_definite(self):
     random.seed(4)
     noun = Noun('toy').definite()
     indefinite = [4, 5, 10]
     plural = [11]
     indefinite_plural = [3]
     for index in range(15):
         to_test = make_noun_error(noun)
         if index in indefinite:
             self.assertEqual(
                 Noun('a toy', base='toy', tags=self.indefinite), to_test)
         elif index in plural:
             self.assertEqual(Noun('toys', base='toy', tags=self.plural),
                              to_test)
         elif index in indefinite_plural:
             self.assertEqual('a toys', to_test.value)
         else:
             self.assertEqual(Noun('toy'), to_test)
Exemplo n.º 7
0
 def test_make_noun_error_plural_definite(self):
     random.seed(8)
     noun = Noun('toy').plural().definite()
     indefinite = [2, 12]
     definite = [10]
     indefinite_plural = [5, 13]
     for index in range(15):
         to_test = make_noun_error(noun)
         if index in indefinite:
             self.assertEqual(
                 Noun('a toy', base='toy', tags=self.indefinite), to_test)
         elif index in definite:
             self.assertEqual(
                 Noun('the toy', base='toy', tags=self.definite), to_test)
         elif index in indefinite_plural:
             self.assertEqual('a toys', to_test.value)
         else:
             self.assertEqual(Noun('toy'), to_test)
Exemplo n.º 8
0
 def test_make_noun_error_plural_proper_with_article(self):
     random.seed(2559)
     noun = Noun.proper_noun('the Joneses', plural=True).capitalize()
     definite = [0, 1, 2, 8]
     for index in range(10):
         to_test = make_noun_error(noun)
         if index in definite:
             self.assertEqual(
                 Noun('the the Joneses',
                      '',
                      'the Joneses',
                      tags=self.definite_plural), to_test)
         else:
             self.assertEqual(
                 Noun('a the Joneses',
                      '',
                      'the Joneses',
                      tags=self.indefinite), to_test)