def test_draw(self): x = 50 y = 700 - 76 colour = (50, 50, 50) r = 5 direction = 1 bullet = snaryad(x, y, r, colour, direction) self.assertAlmostEqual((bullet.x, bullet.y), (50, 700 - 76))
def test_movement_left(self): x = 50 y = 700 - 76 colour = (50, 50, 50) r = 5 direction = -1 bullet = snaryad(x, y, r, colour, direction) bullet.movement(1) self.assertAlmostEqual((bullet.x, bullet.y), (42, 700 - 76))
def test_float_sec(self): x = 50 y = 700 - 76 colour = (50, 50, 50) r = 5 direction = -1 bullet = snaryad(x, y, r, colour, direction) a = bullet.movement(2.5) b = bullet.movement(1.5) self.assertAlmostEqual(b - a, -12)
def test_negative_speed(self): x = 50 y = 700 - 76 colour = (50, 50, 50) r = 5 direction = -1 bullet = snaryad(x, y, r, colour, direction) a = bullet.movement(2) b = bullet.movement(1) self.assertAlmostEqual(b - a, -8)