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