diff options
author | Christian Struck <christian@struck.se> | 2013-01-28 18:15:23 +0100 |
---|---|---|
committer | Christian Struck <christian@struck.se> | 2013-01-28 18:15:23 +0100 |
commit | 80d58383a914b7c65d1d5debe3f78a31ddca5cf7 (patch) | |
tree | 94161bc89ef0ffff924e0d2dc4e002463bce000f | |
parent | 80cc719d353eb5ec511aeeef309218dea1d768a7 (diff) | |
download | bvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.tar.gz bvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.tar.bz2 bvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.zip |
Added tests for the new conversion added in the last commit
-rw-r--r-- | tests/test_api.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index ba2ef71..68e797b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -6,6 +6,21 @@ import unittest from bvggrabber.api import QueryApi, Departure, fullformat, \ compute_remaining +from bvggrabber.utils.format import int2bin + + +class TestUtils(unittest.TestCase): + + def test_int2bin(self): + nums = [(0b1101110, 7, '1101110'), + (0b0010001, 7, '0010001'), + (0b111111, 6, '111111'), + (0b00000001, 8, '00000001'), + (0b00111, 5, '00111'), + (0b1100011, 7, '1100011')] + for b, l, s in nums: + self.assertEqual(int2bin(b, l), s) + class TestFunctions(unittest.TestCase): |