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

Method test_setheading

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

Source from the content-addressed store, hash-verified

422 self.assertAlmostEqual(self.nav.heading(), sum_so_far % 360)
423
424 def test_setheading(self):
425 self.nav.setheading(102.32)
426 self.assertAlmostEqual(self.nav.heading(), 102.32)
427 self.nav.setheading(-123.23)
428 self.assertAlmostEqual(self.nav.heading(), (-123.23) % 360)
429 self.nav.setheading(-1000.34)
430 self.assertAlmostEqual(self.nav.heading(), (-1000.34) % 360)
431 self.nav.setheading(300000)
432 self.assertAlmostEqual(self.nav.heading(), 300000%360)
433
434 def test_positions(self):
435 self.nav.forward(100)

Callers

nothing calls this directly

Calls 3

setheadingMethod · 0.80
assertAlmostEqualMethod · 0.45
headingMethod · 0.45

Tested by

no test coverage detected