From cadc9af0dcd9521d7a75334677fee6150af97456 Mon Sep 17 00:00:00 2001 From: eShuttleworth Date: Wed, 25 Oct 2017 22:46:42 -0400 Subject: [PATCH 1/3] Updated pig_latin_test to v1.1.0 --- exercises/pig-latin/pig_latin_test.py | 35 ++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/exercises/pig-latin/pig_latin_test.py b/exercises/pig-latin/pig_latin_test.py index 9fb5be9f82..d177506c1c 100644 --- a/exercises/pig-latin/pig_latin_test.py +++ b/exercises/pig-latin/pig_latin_test.py @@ -3,69 +3,96 @@ from pig_latin import translate -# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class PigLatinTests(unittest.TestCase): def test_word_beginning_with_a(self): self.assertEqual(translate("apple"), "appleay") + def test_word_beginning_with_e(self): self.assertEqual(translate("ear"), "earay") + def test_word_beginning_with_i(self): self.assertEqual(translate("igloo"), "iglooay") + def test_word_beginning_with_o(self): self.assertEqual(translate("object"), "objectay") + def test_word_beginning_with_u(self): self.assertEqual(translate("under"), "underay") + def test_word_beginning_with_a_vowel_and_followed_by_a_qu(self): self.assertEqual(translate("equal"), "equalay") + def test_word_beginning_with_p(self): self.assertEqual(translate("pig"), "igpay") + def test_word_beginning_with_k(self): self.assertEqual(translate("koala"), "oalakay") - def test_word_beginning_with_y(self): - self.assertEqual(translate("yellow"), "ellowyay") def test_word_beginning_with_x(self): self.assertEqual(translate("xenon"), "enonxay") + def test_word_beginning_with_q_without_a_following_u(self): self.assertEqual(translate("qat"), "atqay") + def test_word_beginning_with_ch(self): self.assertEqual(translate("chair"), "airchay") + def test_word_beginning_with_qu(self): self.assertEqual(translate("queen"), "eenquay") + def test_word_beginning_with_qu_and_a_preceding_consonant(self): self.assertEqual(translate("square"), "aresquay") + def test_word_beginning_with_th(self): self.assertEqual(translate("therapy"), "erapythay") + def test_word_beginning_with_thr(self): self.assertEqual(translate("thrush"), "ushthray") + def test_word_beginning_with_sch(self): self.assertEqual(translate("school"), "oolschay") + def test_word_beginning_with_yt(self): self.assertEqual(translate("yttria"), "yttriaay") + def test_word_beginning_with_xr(self): self.assertEqual(translate("xray"), "xrayay") + + def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word(self): + self.assertEqual(translate("yellow"), "ellowyay") + + + def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster(self): + self.assertEqual(translate("rhythm"), "ythmrhay") + + + def test_y_as_second_letter_in_two_letter_word(self): + self.assertEqual(translate("my"), "ymay") + + def test_a_whole_phrase(self): self.assertEqual(translate("quick fast run"), "ickquay astfay unray") if __name__ == '__main__': - unittest.main() +unittest.main() From 4d02996ad53dd538ea281f31b7291f4647711c76 Mon Sep 17 00:00:00 2001 From: eShuttleworth Date: Wed, 25 Oct 2017 22:49:32 -0400 Subject: [PATCH 2/3] Removed extra newlines --- exercises/pig-latin/pig_latin_test.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/exercises/pig-latin/pig_latin_test.py b/exercises/pig-latin/pig_latin_test.py index d177506c1c..81f599fa59 100644 --- a/exercises/pig-latin/pig_latin_test.py +++ b/exercises/pig-latin/pig_latin_test.py @@ -8,88 +8,67 @@ class PigLatinTests(unittest.TestCase): def test_word_beginning_with_a(self): self.assertEqual(translate("apple"), "appleay") - - + def test_word_beginning_with_e(self): self.assertEqual(translate("ear"), "earay") - def test_word_beginning_with_i(self): self.assertEqual(translate("igloo"), "iglooay") - def test_word_beginning_with_o(self): self.assertEqual(translate("object"), "objectay") - def test_word_beginning_with_u(self): self.assertEqual(translate("under"), "underay") - def test_word_beginning_with_a_vowel_and_followed_by_a_qu(self): self.assertEqual(translate("equal"), "equalay") - def test_word_beginning_with_p(self): self.assertEqual(translate("pig"), "igpay") - def test_word_beginning_with_k(self): self.assertEqual(translate("koala"), "oalakay") - def test_word_beginning_with_x(self): self.assertEqual(translate("xenon"), "enonxay") - def test_word_beginning_with_q_without_a_following_u(self): self.assertEqual(translate("qat"), "atqay") - def test_word_beginning_with_ch(self): self.assertEqual(translate("chair"), "airchay") - def test_word_beginning_with_qu(self): self.assertEqual(translate("queen"), "eenquay") - def test_word_beginning_with_qu_and_a_preceding_consonant(self): self.assertEqual(translate("square"), "aresquay") - def test_word_beginning_with_th(self): self.assertEqual(translate("therapy"), "erapythay") - def test_word_beginning_with_thr(self): self.assertEqual(translate("thrush"), "ushthray") - def test_word_beginning_with_sch(self): self.assertEqual(translate("school"), "oolschay") - def test_word_beginning_with_yt(self): self.assertEqual(translate("yttria"), "yttriaay") - def test_word_beginning_with_xr(self): self.assertEqual(translate("xray"), "xrayay") - def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word(self): self.assertEqual(translate("yellow"), "ellowyay") - def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster(self): self.assertEqual(translate("rhythm"), "ythmrhay") - def test_y_as_second_letter_in_two_letter_word(self): self.assertEqual(translate("my"), "ymay") - def test_a_whole_phrase(self): self.assertEqual(translate("quick fast run"), "ickquay astfay unray") From ea1c80cdefbf0735ff29ac3e45947ea96923dd04 Mon Sep 17 00:00:00 2001 From: eShuttleworth Date: Wed, 25 Oct 2017 23:11:08 -0400 Subject: [PATCH 3/3] Verified canonical accuracy and added version num --- exercises/grains/grains_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/grains/grains_test.py b/exercises/grains/grains_test.py index b7d6ce1fbc..4bdbfb6ad5 100644 --- a/exercises/grains/grains_test.py +++ b/exercises/grains/grains_test.py @@ -5,6 +5,8 @@ total_after, ) +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0 + class GrainsTest(unittest.TestCase): def test_square_1(self):