Exemplo n.º 1
0
    def test_rotate_translate(self):
        c = Coordinates()

        c.translate(0, 10)
        self.assertEqual(c.x, 0)
        self.assertEqual(c.y, 10)

        c.reset()
        c.rotate(math.pi / 2)
        c.translate(0, 10)
        self.assertEqual(c.x, -10)
        self.assertEqual(c.y, 0)
Exemplo n.º 2
0
    def test_reset(self):
        c = Coordinates()
        pos = c.pos
        self.assertEqual(pos[0], 0)
        self.assertEqual(pos[1], 0)

        c.translate(1, 2)
        pos = c.pos
        self.assertNotEqual(pos[0], 0)
        self.assertNotEqual(pos[1], 0)

        c.reset()
        pos = c.pos
        self.assertEqual(pos[0], 0)
        self.assertEqual(pos[1], 0)