Exemple #1
0
def test_unicode():
    screen = Screen(4, 2)
    stream = Stream()
    stream.attach(screen)

    try:
        stream.feed("тест")
    except UnicodeDecodeError:
        pytest.fail("Check your code -- we do accept unicode.")

    assert screen.display == ["тест", "    "]
Exemple #2
0
 def __init__(self, *args, **kwargs):
     Stream.__init__(self, *args, **kwargs)
     self.listeners = defaultdict(lambda: [])