def test_word_begins_with_consonnant_cluster(self): smile = translate('smile') glove = translate('glove') string = translate('string') self.assertEqual(smile, 'ilesmay') self.assertEqual(glove, 'oveglay') self.assertEqual(string, 'ingstray')
def test_110_retains_punctuation_from_original_phrase(self): self.assertEqual(translate('Apple!'), 'Appleay!') self.assertEqual(translate('Banana!!'), 'Ananabay!!') self.assertEqual(translate('Cherry!!!'), 'Errychay!!!') self.assertEqual(translate('Eat Pie!!!!'), 'Eatay Iepay!!!!') self.assertEqual(translate('Three.'), 'Eethray.') self.assertEqual(translate('School?'), 'Oolschay?') self.assertEqual(translate('Quiet...'), 'Ietquay...') self.assertEqual(translate('Square???'), 'Aresquay???') self.assertEqual(translate('The Quick Brown Fox!'), 'Ethay Ickquay Ownbray Oxfay!')
def test_100_translates_capitalized_words(self): self.assertEqual(translate('Apple'), 'Appleay') self.assertEqual(translate('Banana'), 'Ananabay') self.assertEqual(translate('Cherry'), 'Errychay') self.assertEqual(translate('Eat Pie'), 'Eatay Iepay') self.assertEqual(translate('Three'), 'Eethray') self.assertEqual(translate('School'), 'Oolschay') self.assertEqual(translate('Quiet'), 'Ietquay') self.assertEqual(translate('Square'), 'Aresquay') self.assertEqual(translate('The Quick Brown Fox'), 'Ethay Ickquay Ownbray Oxfay')
def test_translates_long_phrases_of_mixed_types_of_words(self): self.assertEqual( translate( "my yellow rhythm square school therapy chair xray igloo apple yttria" ), "ymay ellowyay ythmrhay aresquay oolschay erapythay airchay xrayay iglooay appleay yttriaay" )
def test_word_beginning_with_a(self): self.assertEqual(translate("apple"), "appleay")
def test_word_beginning_with_yt(self): self.assertEqual(translate("yttria"), "yttriaay")
def test_word_beginning_with_qu_and_a_preceding_consonant(self): self.assertEqual(translate("square"), "aresquay")
def test_word_beginning_with_x(self): self.assertEqual(translate("xenon"), "enonxay")
def test_word_beginning_with_a_vowel_and_followed_by_a_qu(self): self.assertEqual(translate("equal"), "equalay")
def test_word_beginning_with_e(self): self.assertEqual(translate("ear"), "earay")
def test_translates_phrase(self): self.assertEqual("ickquay astfay unray", translate("quick fast run"))
def test_word_beginning_with_squ(self): self.assertEqual("aresquay", translate("square"))
def test_y_as_second_letter_in_two_letter_word(self): self.assertEqual(translate("my"), "ymay")
def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster(self): self.assertEqual(translate("rhythm"), "ythmrhay")
def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word(self): self.assertEqual(translate("yellow"), "ellowyay")
def test_word_is_y(self): self.assertEqual(translate("y"), "yay")
import os from common import Quit_Exception from calculator import calculator from area_calculator import calculate from card_trick import trick from pig_latin import translate while True: os.system('clear') print( '\n 1. traducteur de pig latin \n\n 2. tour de cartes \n\n 3. calculateur de l\'aire \n\n 4. calculatrice' ) choice = input('\nchoisi un\n') os.system('clear') try: if choice == '1': while True: translate() if choice == '2': while True: trick() if choice == '3': while True: calculate() if choice == '4': while True: calculator() except Quit_Exception as qe: print('')
def test_word_beginning_with_o(self): self.assertEqual(translate("object"), "objectay")
def test_translate(self): self.assertEqual(translate("apple"), "appleay") self.assertEqual(translate("banana"),"ananabay") self.assertEqual(translate("cherry"),"errychay") self.assertEqual(translate("eat pie"), "eatay iepay") self.assertEqual(translate("three"),"eethray") self.assertEqual(translate("school"),"oolschay") self.assertEqual(translate("quiet"), "ietquay") self.assertEqual(translate("square"), "aresquay") self.assertEqual(translate("the quick brown fox"),"ethay ickquay ownbray oxfay") self.assertEqual(translate("the quick brown Fox"), ("ethay ickquay ownbray Oxfay")) self.assertEqual(translate("the quick, brown...Fox!"), ("ethay ickquay, ownbray...Oxfay!"))
def test_word_beginning_with_k(self): self.assertEqual(translate("koala"), "oalakay")
def test_word_beginning_with_ch(self): self.assertEqual(translate("chair"), "airchay")
def test_word_beginning_with_i(self): self.assertEqual(translate("igloo"), "iglooay")
def test_word_beginning_with_thr(self): self.assertEqual(translate("thrush"), "ushthray")
def test_a_whole_phrase(self): self.assertEqual(translate("quick fast run"), "ickquay astfay unray")
def test_word_beginning_with_u(self): self.assertEqual(translate("under"), "underay")
def test_word_beginning_with_u_and_ends_with_q(self): self.assertEqual(translate("uliq"), "uliqay")
def test_word_beginning_with_p(self): self.assertEqual(translate("pig"), "igpay")
def test_word_beginning_with_y(self): self.assertEqual(translate("yellow"), "ellowyay")
def test_word_beginning_with_q_without_a_following_u(self): self.assertEqual(translate("qat"), "atqay")
def test_word_beginning_with_qu(self): self.assertEqual(translate("queen"), "eenquay")
def test_word_beginning_with_th(self): self.assertEqual(translate("therapy"), "erapythay")
def test_word_beginning_with_sch(self): self.assertEqual(translate("school"), "oolschay")
def test_word_beginning_with_xr(self): self.assertEqual(translate("xray"), "xrayay")