Beispiel #1
0
 def test_edge_case(self):
     """Test a quite complex edge case."""
     self.assertEqual(
         "Oay elloHay-orldWay anmay! aay'yay?",
         pig_it("O Hello-World man! a'y?"),
         "First letter must be appended to the end each word, followed by 'ay'. Punctuation, untouched."
     )
Beispiel #2
0
 def test_leading_punctuation(self):
     """Test a single, simple word."""
     self.assertEqual(
         ",esttay .esttay ;esttay <esttay",
         pig_it(",test .test ;test <test"),
         "First letter must be appended to the end each word, followed by 'ay'. Punctuation, untouched."
     )
Beispiel #3
0
 def test_trailing_punctuation(self):
     """Test several words with punctuation."""
     self.assertEqual(
         "esttay, esttay. esttay; esttay>",
         pig_it("test, test. test; test>"),
         "First letter must be appended to the end each word, followed by 'ay'. Punctuation, untouched."
     )
Beispiel #4
0
 def test_single_word(self):
     """Test a single, simple word, with no punctuation."""
     self.assertEqual(
         "esttay", pig_it("test"),
         "First letter must be appended to the end each word, followed by 'ay'."
     )
Beispiel #5
0
 def test_can_run(self):
     pig_it("test")
Beispiel #6
0
 def test_two_words(self):
     """Test two, simple words, with no punctuation."""
     self.assertEqual(
         "esttay tringsay", pig_it("test string"),
         "First letter must be appended to the end each word, followed by 'ay'."
     )