예제 #1
0
def test_random_position_2():
    space = '..........\n' \
            '..........\n' \
            '..........\n' \
            '........X.\n' \
            '..........'
    assert find_spaceship(space) == [8, 1]
예제 #2
0
def test_no_ship_long_column(lost_forever):
    assert find_spaceship('\n\n\n\n') == lost_forever
예제 #3
0
def test_no_ship_long_line(lost_forever):
    assert find_spaceship('........................') == lost_forever
예제 #4
0
def test_bottom_left_wide_space():
    assert find_spaceship('.......\nX.......') == [0, 0]
예제 #5
0
def test_bottom_right():
    assert find_spaceship('..\n.X') == [1, 0]
예제 #6
0
def test_bottom_left():
    assert find_spaceship('..\nX.') == [0, 0]
예제 #7
0
def test_top_right():
    assert find_spaceship('.X\n..') == [1, 1]
예제 #8
0
def test_top():
    assert find_spaceship('X\n.') == [0, 1]
예제 #9
0
def test_one_place():
    assert find_spaceship('X') == [0, 0]
예제 #10
0
def test_expected_return_value_is_str_if_finding_is_not_possible():
    assert type(find_spaceship('')) == str
예제 #11
0
def test_expected_return_value_is_list_if_finding_is_possible():
    assert type(find_spaceship('X')) == list