Example #1
0
 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')
Example #4
0
 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"
     )
Example #5
0
 def test_word_beginning_with_a(self):
     self.assertEqual(translate("apple"), "appleay")
Example #6
0
 def test_word_beginning_with_yt(self):
     self.assertEqual(translate("yttria"), "yttriaay")
Example #7
0
 def test_word_beginning_with_qu_and_a_preceding_consonant(self):
     self.assertEqual(translate("square"), "aresquay")
Example #8
0
 def test_word_beginning_with_x(self):
     self.assertEqual(translate("xenon"), "enonxay")
Example #9
0
 def test_word_beginning_with_a_vowel_and_followed_by_a_qu(self):
     self.assertEqual(translate("equal"), "equalay")
Example #10
0
 def test_word_beginning_with_e(self):
     self.assertEqual(translate("ear"), "earay")
Example #11
0
 def test_translates_phrase(self):
     self.assertEqual("ickquay astfay unray", translate("quick fast run"))
Example #12
0
 def test_word_beginning_with_squ(self):
     self.assertEqual("aresquay", translate("square"))
Example #13
0
 def test_y_as_second_letter_in_two_letter_word(self):
     self.assertEqual(translate("my"), "ymay")
Example #14
0
 def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster(self):
     self.assertEqual(translate("rhythm"), "ythmrhay")
Example #15
0
 def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word(self):
     self.assertEqual(translate("yellow"), "ellowyay")
Example #16
0
 def test_word_is_y(self):
     self.assertEqual(translate("y"), "yay")
Example #17
0
 def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster(self):
     self.assertEqual(translate("rhythm"), "ythmrhay")
Example #18
0
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('')
Example #19
0
 def test_word_beginning_with_o(self):
     self.assertEqual(translate("object"), "objectay")
Example #20
0
 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!"))
Example #21
0
 def test_word_beginning_with_k(self):
     self.assertEqual(translate("koala"), "oalakay")
Example #22
0
 def test_word_beginning_with_e(self):
     self.assertEqual(translate("ear"), "earay")
Example #23
0
 def test_word_beginning_with_ch(self):
     self.assertEqual(translate("chair"), "airchay")
Example #24
0
 def test_word_beginning_with_i(self):
     self.assertEqual(translate("igloo"), "iglooay")
Example #25
0
 def test_word_beginning_with_thr(self):
     self.assertEqual(translate("thrush"), "ushthray")
Example #26
0
 def test_word_beginning_with_o(self):
     self.assertEqual(translate("object"), "objectay")
Example #27
0
 def test_a_whole_phrase(self):
     self.assertEqual(translate("quick fast run"), "ickquay astfay unray")
Example #28
0
 def test_word_beginning_with_u(self):
     self.assertEqual(translate("under"), "underay")
Example #29
0
 def test_a_whole_phrase(self):
     self.assertEqual(translate("quick fast run"), "ickquay astfay unray")
Example #30
0
 def test_word_beginning_with_a_vowel_and_followed_by_a_qu(self):
     self.assertEqual(translate("equal"), "equalay")
Example #31
0
 def test_word_beginning_with_u_and_ends_with_q(self):
     self.assertEqual(translate("uliq"), "uliqay")
Example #32
0
 def test_word_beginning_with_p(self):
     self.assertEqual(translate("pig"), "igpay")
Example #33
0
 def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word(self):
     self.assertEqual(translate("yellow"), "ellowyay")
Example #34
0
 def test_word_beginning_with_k(self):
     self.assertEqual(translate("koala"), "oalakay")
Example #35
0
 def test_y_as_second_letter_in_two_letter_word(self):
     self.assertEqual(translate("my"), "ymay")
Example #36
0
 def test_word_beginning_with_y(self):
     self.assertEqual(translate("yellow"), "ellowyay")
Example #37
0
 def test_word_beginning_with_i(self):
     self.assertEqual(translate("igloo"), "iglooay")
Example #38
0
 def test_word_beginning_with_x(self):
     self.assertEqual(translate("xenon"), "enonxay")
Example #39
0
 def test_word_beginning_with_u(self):
     self.assertEqual(translate("under"), "underay")
Example #40
0
 def test_word_beginning_with_q_without_a_following_u(self):
     self.assertEqual(translate("qat"), "atqay")
Example #41
0
 def test_word_beginning_with_p(self):
     self.assertEqual(translate("pig"), "igpay")
Example #42
0
 def test_word_beginning_with_ch(self):
     self.assertEqual(translate("chair"), "airchay")
Example #43
0
 def test_word_beginning_with_y(self):
     self.assertEqual(translate("yellow"), "ellowyay")
Example #44
0
 def test_word_beginning_with_qu(self):
     self.assertEqual(translate("queen"), "eenquay")
Example #45
0
 def test_word_beginning_with_q_without_a_following_u(self):
     self.assertEqual(translate("qat"), "atqay")
Example #46
0
 def test_word_beginning_with_qu_and_a_preceding_consonant(self):
     self.assertEqual(translate("square"), "aresquay")
Example #47
0
 def test_word_beginning_with_qu(self):
     self.assertEqual(translate("queen"), "eenquay")
Example #48
0
 def test_word_beginning_with_th(self):
     self.assertEqual(translate("therapy"), "erapythay")
Example #49
0
 def test_word_beginning_with_th(self):
     self.assertEqual(translate("therapy"), "erapythay")
Example #50
0
 def test_word_beginning_with_thr(self):
     self.assertEqual(translate("thrush"), "ushthray")
Example #51
0
 def test_word_beginning_with_sch(self):
     self.assertEqual(translate("school"), "oolschay")
Example #52
0
 def test_word_beginning_with_sch(self):
     self.assertEqual(translate("school"), "oolschay")
Example #53
0
 def test_word_beginning_with_xr(self):
     self.assertEqual(translate("xray"), "xrayay")
Example #54
0
 def test_word_beginning_with_yt(self):
     self.assertEqual(translate("yttria"), "yttriaay")
Example #55
0
 def test_word_beginning_with_a(self):
     self.assertEqual(translate("apple"), "appleay")
Example #56
0
 def test_word_beginning_with_xr(self):
     self.assertEqual(translate("xray"), "xrayay")