Esempio n. 1
0
class TestRhymerFunctions(unittest.TestCase):
    def setUp(self):
        self.rhymer = Rhymer()

    def test_rhyme(self):
        word1 = "call"
        word2 = "ball"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, True)

    def test_no_rhyme(self):
        word1 = "call"
        word2 = "one"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)

    def test_wrong_stress(self):
        word1 = "someone"
        word2 = "one"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)

    def test_bad_input(self):
        word1 = "sq32e"
        word2 = "one"
        output = self.rhymer.isInDict(word1)
        self.assertEqual(output, False)
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)
Esempio n. 2
0
class TestRhymerFunctions(unittest.TestCase):
    def setUp(self):
        self.rhymer = Rhymer()

    def test_rhyme(self):
        word1 = "call"
        word2 = "ball"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, True)

    def test_no_rhyme(self):
        word1 = "call"
        word2 = "one"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)

    def test_wrong_stress(self):
        word1 = "someone"
        word2 = "one"
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)

    def test_bad_input(self):
        word1 = "sq32e"
        word2 = "one"
        output = self.rhymer.isInDict(word1)
        self.assertEqual(output, False)
        output = self.rhymer.rhymes(word1, word2)
        self.assertEqual(output, False)
Esempio n. 3
0
 def setUp(self):
     self.rhymer = Rhymer()
Esempio n. 4
0
 def setUp(self):
     self.rhymer = Rhymer()