|
@@ -382,6 +382,10 @@ class ASN1Coder(object): |
|
|
|
|
|
|
|
|
return r |
|
|
return r |
|
|
|
|
|
|
|
|
|
|
|
_coder = ASN1Coder() |
|
|
|
|
|
dumps = _coder.dumps |
|
|
|
|
|
loads = _coder.loads |
|
|
|
|
|
|
|
|
def deeptypecmp(obj, o): |
|
|
def deeptypecmp(obj, o): |
|
|
#print 'dtc:', `obj`, `o` |
|
|
#print 'dtc:', `obj`, `o` |
|
|
if type(obj) != type(o): |
|
|
if type(obj) != type(o): |
|
@@ -438,10 +442,6 @@ def genfailures(obj): |
|
|
else: |
|
|
else: |
|
|
raise AssertionError('uncaught modification: %s, byte %d, orig: %02x' % (ts.encode('hex'), i, ord(s[i]))) |
|
|
raise AssertionError('uncaught modification: %s, byte %d, orig: %02x' % (ts.encode('hex'), i, ord(s[i]))) |
|
|
|
|
|
|
|
|
_coder = ASN1Coder() |
|
|
|
|
|
dumps = _coder.dumps |
|
|
|
|
|
loads = _coder.loads |
|
|
|
|
|
|
|
|
|
|
|
class TestCode(unittest.TestCase): |
|
|
class TestCode(unittest.TestCase): |
|
|
def test_primv(self): |
|
|
def test_primv(self): |
|
|
self.assertEqual(dumps(-257), '0202feff'.decode('hex')) |
|
|
self.assertEqual(dumps(-257), '0202feff'.decode('hex')) |
|
|