Exemplo n.º 1
0
def test_angle_dutycycle_inverse(angle):
    """Test the results of angle_to_dutycycle against its inverse, dutycycle_to_angle,
    angle = ((dutycycle / 5) - 1) * 180. Passing of this test implies that
    dutycycle_to_angle gives the proper results given angle_to_dutycycle.
    """
    assert(math.isclose(motor.dutycycle_to_angle(motor.angle_to_dutycycle(angle)), angle))
Exemplo n.º 2
0
def test_dutycycle_to_angle_range(dc):
    """Test that dutycycle_to_angle returns angles not less than -180."""
    assert(-180 <= motor.dutycycle_to_angle(dc))