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