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