Exemple #1
0
def which_translation(argument):
    if argument == 'M':
        return morse_to_text(message)
    elif argument == 'T':
        return text_to_morse(message)
    else:
        pass
Exemple #2
0
def test_atext():
    assert morseovka.text_to_morse("A") == ".-///"
Exemple #3
0
def test_cisla_a_dalsi():
    assert morseovka.text_to_morse("42!") == ("....-/..---/--..--///")
Exemple #4
0
def test_na_vice_radku():
    assert morseovka.text_to_morse("Ahoj\nheslo je KORÝŠ\n") == ".-/..../---/.---//\n...././.../.-../---//.---/.//-.-/---/.-./-.--/...///"
Exemple #5
0
def test_spatneho_znaku():
    with pytest.raises(KeyError):
        morseovka.text_to_morse("螭")
Exemple #6
0
def test_smichu():
    assert morseovka.text_to_morse("cha cha cha") == "----/.-//----/.-//----/.-///"
Exemple #7
0
def test_veta_slovak():
    assert morseovka.text_to_morse("Ľubozvučné slovenské slová sú guľôčka, stĺp, pŕŕ!") == ".-../..-/-.../---/--../...-/..-/-.-./-././/.../.-../---/...-/./-./.../-.-/.//.../.-../---/...-/.-//.../..-//--./..-/.-../---/-.-./-.-/.-/--..--//.../-/.-../.--./--..--//.--./.-./.-./--...-///"
Exemple #8
0
def test_veta():
    assert morseovka.text_to_morse("Tohle je věta") == "-/---/..../.-.././/.---/.//...-/./-/.-///"