# Path: smarkets/uuid.py
# def int_to_uuid(number, ttype):
#     """Convert an untagged integer into a tagged uuid
# 
#     :type ttype: str or unicode on Python 2, str on Python 3
#     """
#     return Uuid.from_int(number, ttype).to_hex()
# 
# def uid_or_int_to_int(value, expected_type):
#     if not isinstance(value, integer_types):
#         value, type_ = uuid_to_int(value, return_tag='type')
#         if type_ != expected_type:
#             raise ValueError("Expected tag %r doesn't match %r" % (expected_type, type_))
# 
#     return value


from nose.tools import eq_
from smarkets.uuid import int_to_uuid, uid_or_int_to_int
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals




def test_uid_or_int_to_int():
    eq_(uid_or_int_to_int(1234, 'irrelevant'), 1234)

# Path: smarkets/uuid.py
# def int_to_uuid(number, ttype):
#     """Convert an untagged integer into a tagged uuid
# 
#     :type ttype: str or unicode on Python 2, str on Python 3
#     """
#     return Uuid.from_int(number, ttype).to_hex()
# 
# def uid_or_int_to_int(value, expected_type):
#     if not isinstance(value, integer_types):
#         value, type_ = uuid_to_int(value, return_tag='type')
#         if type_ != expected_type:
#             raise ValueError("Expected tag %r doesn't match %r" % (expected_type, type_))
# 
#     return value


# Path: smarkets/tests/uuid.py
from nose.tools import eq_
from smarkets.uuid import int_to_uuid, uid_or_int_to_int

# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals




def test_uid_or_int_to_int():
    eq_(uid_or_int_to_int(1234, 'irrelevant'), 1234)

    eq_(uid_or_int_to_int(int_to_uuid(5454, 'Contract'), 'Contract'), 5454)