Beispiel #1
0
  def testRpmmvIsNotALegalWord(self):
    """
    `Rpmmv` is not a legal word, because there are no vowels.
    """
    poetry = Poetry()
    word = "Rpmmv"

    results = poetry.isLegalWord(word)

    self.assertEqual(False, results)
Beispiel #2
0
  def testRymmvIsALegalWord(self):
    """
    In the word, `Rymmv`, y acts as a vowel, therefore `Rymmv` is a legal word.
    """
    poetry = Poetry()
    word = "Rymmv"

    results = poetry.isLegalWord(word)

    self.assertEqual(True, results)
Beispiel #3
0
  def test4ppleIsNotALegalWord(self):
    """
    A legal word does not contain numbers, because it does not belong in
    a-zA-Z.
    """
    poetry = Poetry()
    word = "4pple"

    results = poetry.isLegalWord(word)

    self.assertEqual(False, results)
Beispiel #4
0
  def testAppleIsALegalWord(self):
    """
    `apple` is a word because...
    (1) every letter belongs in a-zA-Z,
    (2) there is at least one vowel—in this example, there are exactly 2.
    """
    poetry = Poetry()
    word   = "apple"

    results = poetry.isLegalWord(word)

    self.assertEqual(True, results)