def test_multiple_sentences(self):
     self.assertEqual(
         piglatin(
             "With great power comes great responsibility\n I 3anurag anurag3"
         ),
         "ithWay reatgay owerpay omescay reatgay esponsibilityray\n Iay 3nuragaay nuragaay3"
     )
     self.assertEqual(piglatin("Alex=+, how did you do question 21?"),
                      "lexAay=+, owhay idday ouyay oday uestionqay 21?")
Exemplo n.º 2
0
    def test_pig_latin_y(self):
        """
        'y' should be treated differently whether it starts the word or is
        in the middle.
        """
        expected = "ellowyay"
        self.assertEqual(expected, piglatin("yellow"))

        expected = "ythmrhay"
        self.assertEqual(expected, piglatin("rhythm"))
Exemplo n.º 3
0
    def test_pig_latin_begin_vowel(self):
        """Words that begin with vowels should be suffixed with 'way' """
        expected = "eggway"
        self.assertEqual(expected, piglatin("egg"))

        expected = "inboxway"
        self.assertEqual(expected, piglatin("inbox"))

        expected = "eightway"
        self.assertEqual(expected, piglatin("eight"))
Exemplo n.º 4
0
    def test_pig_latin_begin_consonant(self):
        """
        Words that begin with consonants should have them moved to the end
        and suffixed with 'ay'
        """
        expected = "appyhay"
        self.assertEqual(expected, piglatin("happy"))

        expected = "uckday"
        self.assertEqual(expected, piglatin("duck"))

        expected = "oveglay"
        self.assertEqual(expected, piglatin("glove"))
Exemplo n.º 5
0
 def write_latin(data):
     write(piglatin(data))
Exemplo n.º 6
0
 def __next__(self):
     if self.transform_ok:
         return piglatin(self._next())
     else:
         return self._next()
 def test_no_alphabets(self):
     self.assertEqual(piglatin("@123$,"), "@123$,")
 def test_empty_string(self):
     self.assertEqual(piglatin(""), "")
 def test_middle_numbers(self):
     self.assertEqual(piglatin("I2 am2 gr00t"), "Iay2 maay2 r00tgay")
Exemplo n.º 10
0
 def write_latin(data):
     write(piglatin(data))  # call must be byte-safe on Py3
Exemplo n.º 11
0
 def __next__(self):
     if self.transform_ok:
         return piglatin(self._next())  # call must be byte-safe on Py3
     else:
         return self._next()
Exemplo n.º 12
0
 def write_latin(data):
     write(piglatin(data))   # call must be byte-safe on Py3
Exemplo n.º 13
0
 def __next__(self):
     if self.transform_ok:
         return piglatin(self._next())   # call must be byte-safe on Py3
     else:
         return self._next()