summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Struck <christian@struck.se>2013-01-28 18:15:23 +0100
committerChristian Struck <christian@struck.se>2013-01-28 18:15:23 +0100
commit80d58383a914b7c65d1d5debe3f78a31ddca5cf7 (patch)
tree94161bc89ef0ffff924e0d2dc4e002463bce000f /tests
parent80cc719d353eb5ec511aeeef309218dea1d768a7 (diff)
downloadbvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.tar.gz
bvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.tar.bz2
bvg-grabber-80d58383a914b7c65d1d5debe3f78a31ddca5cf7.zip
Added tests for the new conversion added in the last commit
Diffstat (limited to 'tests')
-rw-r--r--tests/test_api.py15
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):