summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2016-03-25 22:58:58 +0100
committerIlya Etingof <etingof@gmail.com>2016-03-25 22:58:58 +0100
commit3b85b928ab3f73be03b3d9589f3b2815dbb10938 (patch)
tree30aafa9955e01fb29f7c1846176658ad4ead9f0d /test
parent783e11640871274f38eac64e67b5a7b1c5e74a52 (diff)
downloadpyasn1-git-3b85b928ab3f73be03b3d9589f3b2815dbb10938.tar.gz
BitString.toHexString() refactored into .asOctets() and .asNumbers()
Diffstat (limited to 'test')
-rw-r--r--test/type/test_univ.py9
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: