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