diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-03-25 22:58:58 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-03-25 22:58:58 +0100 |
commit | 3b85b928ab3f73be03b3d9589f3b2815dbb10938 (patch) | |
tree | 30aafa9955e01fb29f7c1846176658ad4ead9f0d /test | |
parent | 783e11640871274f38eac64e67b5a7b1c5e74a52 (diff) | |
download | pyasn1-git-3b85b928ab3f73be03b3d9589f3b2815dbb10938.tar.gz |
BitString.toHexString() refactored into .asOctets() and .asNumbers()
Diffstat (limited to 'test')
-rw-r--r-- | test/type/test_univ.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/type/test_univ.py b/test/type/test_univ.py index 87a76a4..ffdc802 100644 --- a/test/type/test_univ.py +++ b/test/type/test_univ.py @@ -129,10 +129,13 @@ class BitStringTestCase(unittest.TestCase): assert self.b.clone("'A98A'H")[0] == 1 assert self.b.clone("'A98A'H")[1] == 0 assert self.b.clone("'A98A'H")[2] == 1 - def testToHexString(self): - assert self.b.clone("'A98A'H").toHexString() == 'A98A' + def testAsOctets(self): + assert self.b.clone(hexValue='A98A').asOctets() == ints2octs((0xa9, 0x8a)), 'testAsOctets() fails' + def testAsInts(self): + assert self.b.clone(hexValue='A98A').asNumbers() == (0xa9, 0x8a), 'testAsNumbers() fails' + def testMultipleOfEight(self): try: - self.b.clone((1, 0, 1)).toHexString() + self.b.clone((1, 0, 1)).asOctets() except PyAsn1Error: pass else: |