def test_copy_element(self): element = ElementBase('#') tocopy_element = ElementBase('.') element.pos = (21, 42) tocopy_element.pos = (42, 21) element.copy_element(tocopy_element) self.assertEqual(element.pos, tocopy_element.pos)
def test_make_door_skin(self): element = ElementBase('#') collide_element = ElementBase('O') collide_element.collide = False element.make_door(collide_element) self.assertEqual(collide_element.skin, '.')
def test_make_door_collide(self): element = ElementBase('#') collide_element = ElementBase('.') collide_element.collide = False element.make_door(collide_element) self.assertEqual(collide_element.collide, True)
def test_make_wall_collide(self): element = ElementBase('#') collide_element = ElementBase('.') collide_element.collide = True element.make_wall(collide_element) self.assertEqual(collide_element.collide, False)
def test_make_wall_skin(self): element = ElementBase('#') collide_element = ElementBase('.') collide_element.collide = True element.make_wall(collide_element) self.assertEqual(collide_element.skin, 'O')
def test_pos_x_setter(self): element = ElementBase('#') element.pos = (80, 18) self.assertEqual(element.x, 80)
def test_move_right_non_static(self): element = ElementBase('#') element.static = False element.pos = (80, 18) element.move_right() self.assertEqual(element.pos, (81, 18))
def test_move_left_static(self): element = ElementBase('#') element.static = True element.pos = (80, 18) element.move_left() self.assertEqual(element.pos, (80, 18))
def test_move_down_non_static(self): element = ElementBase('#') element.static = False element.pos = (80, 18) element.move_down() self.assertEqual(element.pos, (80, 19))