(self)
| 369 | self.assertAlmostEqual(self.nav.heading(), 90) |
| 370 | |
| 371 | def test_towards(self): |
| 372 | |
| 373 | coordinates = [ |
| 374 | # coordinates, expected |
| 375 | ((100, 0), 0.0), |
| 376 | ((100, 100), 45.0), |
| 377 | ((0, 100), 90.0), |
| 378 | ((-100, 100), 135.0), |
| 379 | ((-100, 0), 180.0), |
| 380 | ((-100, -100), 225.0), |
| 381 | ((0, -100), 270.0), |
| 382 | ((100, -100), 315.0), |
| 383 | ] |
| 384 | |
| 385 | for (x, y), expected in coordinates: |
| 386 | self.assertEqual(self.nav.towards(x, y), expected) |
| 387 | self.assertEqual(self.nav.towards((x, y)), expected) |
| 388 | self.assertEqual(self.nav.towards(Vec2D(x, y)), expected) |
| 389 | |
| 390 | def test_heading(self): |
| 391 |
nothing calls this directly
no test coverage detected