Beispiel #1
0
def test_translation_from_morse_code_to_alphabet_autobus():
    """Překlad z Morseovy abecedy do Abecedy - autobus."""
    assert (main.translation("\".-|..-|-|---|-...|..-|...\"",
                             False) == "autobus")
Beispiel #2
0
def test_translation_from_morse_code_to_alphabet_SOS():
    """Překlad z Morseovy abecedy do Abecedy - SOS."""
    assert main.translation("\"...|---|...\"", False) == "sos"
Beispiel #3
0
def test_translation_from_morse_code_to_alphabet():
    """Překlad z Morseovy abecedy do Abecedy - ahoj jmenuji se martin."""
    assert (main.translation(
        "\".-|....|---|.---| |.---|--|.|-.|..-|.---"
        "|..| |...|.| |--|.-|.-.|-|..|-.\"",
        False) == "ahoj jmenuji se martin")
Beispiel #4
0
def test_none():
    """None string."""
    assert main.translation(None, True) == ""
Beispiel #5
0
def test_empty_string():
    """Prázdný string."""
    assert main.translation("", True) == ""
Beispiel #6
0
def test_white_space_start_end():
    """Mezera na začátku a konci slova."""
    assert (main.translation(
        "\"  .-..|.-|...-|..|-.-.|.| |.-| |-|.-|-..."
        "|..-|.-..|.  \"", False) == "lavice a tabule")
Beispiel #7
0
def test_translation_from_alphabet_to_morse_code():
    """Překlad z Abecedy do Morseovy abecedy."""
    assert (main.translation("\"Jmenuji se Martin\"",
                             True) == ".-----.-...-.---.. .... --.-.-.-..-.")
Beispiel #8
0
def test_white_space_start():
    """Mezera na začátku slova."""
    assert (main.translation("\" -|---| |.---|...|.|--| |.---|.-\"",
                             False) == "to jsem ja")
Beispiel #9
0
def test_white_space_end():
    """Mezera na konci slova."""
    assert (main.translation("\"--|.-|--| |....|.-..|.-|-..  \"",
                             False) == "mam hlad")
Beispiel #10
0
def test_translation_from_alphabet_to_morse_code_white_space():
    """Překlad z Abecedy do Morseovy abecedy - mezery."""
    assert main.translation("\"  \"", True) == ""
Beispiel #11
0
def test_translation_from_alphabet_to_morse_code_SOS():
    """Překlad z Abecedy do Morseovy abecedy - SOS."""
    assert main.translation("\"SOS\"", True) == "...---..."
Beispiel #12
0
def test_translation_from_alphabet_to_morse_code_autobus():
    """Překlad z Abecedy do Morseovy abecedy - autobus."""
    assert main.translation("\"Autobus\"", True) == ".-..------.....-..."