def test_get_pwm_None(self):
        headroom = None

        pwm = _get_pwm(headroom=headroom)

        assert isinstance(pwm, type(None))
    def test_get_pwm_zero(self):
        headroom = 0.0

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 0
    def test_get_pwm_full(self):
        headroom = 1.0

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 255
    def test_get_pwm_middle(self):
        headroom = 0.5

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 128
Пример #5
0
    def test_get_pwm_zero(self):
        headroom = 0.0

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 0
Пример #6
0
    def test_get_pwm_middle(self):
        headroom = 0.5

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 128
Пример #7
0
    def test_get_pwm_None(self):
        headroom = None

        pwm = _get_pwm(headroom=headroom)

        assert isinstance(pwm, type(None))
Пример #8
0
    def test_get_pwm_full(self):
        headroom = 1.0

        pwm = _get_pwm(headroom=headroom)

        assert pwm == 255