Browse Source

move these definitions before the tests...

[git-p4: depot-paths = "//depot/python/pypasn1/main/": change = 1829]
python2
John-Mark Gurney 8 years ago
parent
commit
56ac492e8d
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      pasn1.py

+ 4
- 4
pasn1.py View File

@@ -382,6 +382,10 @@ class ASN1Coder(object):

return r

_coder = ASN1Coder()
dumps = _coder.dumps
loads = _coder.loads

def deeptypecmp(obj, o):
#print 'dtc:', `obj`, `o`
if type(obj) != type(o):
@@ -438,10 +442,6 @@ def genfailures(obj):
else:
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):
def test_primv(self):
self.assertEqual(dumps(-257), '0202feff'.decode('hex'))


Loading…
Cancel
Save