-
Notifications
You must be signed in to change notification settings - Fork 0
/
tickertest.py
41 lines (31 loc) · 990 Bytes
/
tickertest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
# python -m unittest tickertest.py
import unittest
import ticker
class TestTickerTextConversion(unittest.TestCase):
def test_upper(self):
self.assertEqual(
ticker.convert_ticker_text("SSSSSSSSS"),
"555555555")
self.assertEqual(
ticker.convert_ticker_text("[][][][]["),
"()()()()(")
self.assertEqual(
ticker.convert_ticker_text(" "),
"!!!!!!!!!")
class TestWindowSizeArgs(unittest.TestCase):
def test(self):
self.assertEqual(
ticker.get_width_and_height(None, None),
(520, 100))
self.assertEqual(
ticker.get_width_and_height(100, None),
(100, 19))
self.assertEqual(
ticker.get_width_and_height(None, 200),
(1040, 200))
self.assertEqual(
ticker.get_width_and_height(0, 1),
(0, 1))
if __name__ == '__main__':
unittest.main()