def test_click_flag(): e = Engine(10, 10, 1) orig_space = e.get_display_board()[0, 0] e.toggle_flag(0, 0) assert e.get_display_board()[0, 0] == Spaces.FLAG e.check_location(0, 0) assert e.get_display_board()[0, 0] == orig_space
def test_toggle_flag(): e = Engine(10, 10, 10) orig_space = e.get_display_board()[0, 0] e.toggle_flag(0, 0) assert e.get_display_board()[0, 0] == Spaces.FLAG e.toggle_flag(0, 0) assert e.get_display_board()[0, 0] == orig_space
def test_display_board(): b1 = np.array([[Spaces.BOMB, Spaces.UNKNOWN], [Spaces.BOMB, Spaces.BOMB]]) e = Engine(10, 10, 10) e._board = b1 dboard = e.get_display_board() assert dboard[0, 0] == Spaces.UNKNOWN assert dboard[0, 1] == Spaces.UNKNOWN assert dboard[1, 0] == Spaces.UNKNOWN assert dboard[1, 1] == Spaces.UNKNOWN