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