def test_both_top_and_bottom_open(): cell = Cell( left=False, right=False, front=False, back=False, top=True, bottom=True, ) rendered = render_cell(cell) assert rendered[2][5] == ' ' assert rendered[2][4] == 'U' assert rendered[2][6] == 'D'
def test_lateral_directions(): cell = Cell( left=OUT, right=OUT, front=OUT, back=OUT, top=False, bottom=False, ) rendered = render_cell(cell) assert rendered[2][2] == '<' assert rendered[2][8] == '>' assert rendered[1][5] == '^' assert rendered[3][5] == 'v'
def test_single_bottom_opening(): cell = Cell( left=False, right=False, front=False, back=False, top=False, bottom=True, ) rendered = render_cell(cell) assert rendered[2][5] == 'D' # sanity check assert rendered[2][4] == ' ' assert rendered[2][6] == ' '
def test_open_back(): cell = Cell( left=False, right=False, front=False, back=OUT, top=False, bottom=False, ) expected = ( list("-----------"), list("| |"), list("| |"), list("| v |"), list("- -"), ) rendered = render_cell(cell) assert all(left == right for left, right in zip(rendered, expected))
def test_blank_cell(): cell = Cell(False, False, False, False, False, False) rendered = render_cell(cell) assert rendered == BLANK_CELL