File: test_channel_fade.py

package info (click to toggle)
pyartnet 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 668 kB
  • sloc: python: 1,845; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 561 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from unittest.mock import Mock

from pyartnet.base import Channel
from pyartnet.base.channel_fade import ChannelBoundFade


def test_repr() -> None:
    universe = Mock()
    universe.output_correction = None

    a = Channel(universe, 1, 2)

    a = ChannelBoundFade(a, [])
    assert repr(a) == '<ChannelBoundFade channel=1/2, is_done=False>'

    a.is_done = True
    assert repr(a) == '<ChannelBoundFade channel=1/2, is_done=True>'

    a = ChannelBoundFade(a, [])
    a.channel = None
    assert repr(a) == '<ChannelBoundFade channel=None, is_done=False>'