MCPcopy Index your code
hub / github.com/python/cpython / test_distance_method

Method test_distance_method

Lib/test/test_turtle.py:452–459  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

450 self.assertAlmostEqual(self.nav.heading(), 0)
451
452 def test_distance_method(self):
453 self.assertAlmostEqual(self.nav.distance(30, 40), 50)
454 vec = Vec2D(0.22, .001)
455 self.assertAlmostEqual(self.nav.distance(vec), 0.22000227271553355)
456 another_turtle = turtle.TNavigator()
457 another_turtle.left(90)
458 another_turtle.forward(10000)
459 self.assertAlmostEqual(self.nav.distance(another_turtle), 10000)
460
461
462class TestTPen(unittest.TestCase):

Callers

nothing calls this directly

Calls 5

leftMethod · 0.95
forwardMethod · 0.95
distanceMethod · 0.80
Vec2DClass · 0.70
assertAlmostEqualMethod · 0.45

Tested by

no test coverage detected