Beispiel #1
0
    def test_empty_adjectives_nouns(self):
        haikunator = Haikunator()
        haikunator.adjectives = []
        haikunator.nouns = []

        haiku = haikunator.haikunate(token_chars='')
        self.assertEqual(haiku, '')
    def test_empty_adjectives_nouns(self):
        haikunator = Haikunator()
        haikunator.adjectives = []
        haikunator.nouns = []

        haiku = haikunator.haikunate(token_chars='')
        self.assertEqual(haiku, '')
Beispiel #3
0
    def test_custom_adjectives_nouns(self):
        haikunator = Haikunator()
        haikunator.adjectives = ['red']
        haikunator.nouns = ['reindeer']

        self.assertRegexp(haikunator.haikunate(),
                          '(red)(-)(reindeer)(-)(\\d{4})$')
    def test_custom_adjectives_nouns(self):
        haikunator = Haikunator()
        haikunator.adjectives = ['red']
        haikunator.nouns = ['reindeer']

        self.assertRegexp(haikunator.haikunate(), '(red)(-)(reindeer)(-)(\\d{4})$')