Skip to content

Add test to check OID repr returns correct results #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions gssapi/tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,23 @@ def test_basic_wrap_unwrap(self):
unwrapped_message.should_be_a(bytes)
unwrapped_message.shouldnt_be_empty()
unwrapped_message.should_be(b'test message')


TEST_OIDS = {'SPNEGO': {'bytes': '\053\006\001\005\005\002',
'string': '<OID 1.3.6.1.5.5.2>'},
'KRB5': {'bytes': '\052\206\110\206\367\022\001\002\002',
'string': '<OID 1.2.840.113554.1.2.2>'},
'KRB5_OLD': {'bytes': '\053\005\001\005\002',
'string': '<OID 1.3.5.1.5.2>'},
'KRB5_WRONG': {'bytes': '\052\206\110\202\367\022\001\002\002',
'string': '<OID 1.2.840.48018.1.2.2>'},
'IAKERB': {'bytes': '\053\006\001\005\002\005',
'string': '<OID 1.3.6.1.5.2.5>'}}


class TestOIDTransforms(unittest.TestCase):
def test_decode_from_bytes(self):
for oid in TEST_OIDS.values():
o = gb.OID(elements=oid['bytes'])
text = repr(o)
text.should_be(oid['string'])