def test_x(self): new_coord = Coord(2, 2) self.assertEqual(new_coord.get_x(), 2) new_coord.set_x(10) self.assertEqual(new_coord.get_x(), 10) self.assertFalse(new_coord.get_occupied())
def test_str(self): new_coord = Coord(1, 1) self.assertEqual(new_coord.__str__(), str(new_coord.get_x()) + ',' + str(new_coord.get_y()))
def verify_valid_coord(self, coord: Coord): if 0 <= coord.get_x() < self.rows and 0 <= coord.get_y( ) < self.columns: return True else: return False