# Path: arangodb/six.py
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
#         MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 63) - 1)
#         class X(object):
# class _LazyDescr(object):
# class MovedModule(_LazyDescr):
# class _LazyModule(types.ModuleType):
# class MovedAttribute(_LazyDescr):
# class _MovedItems(_LazyModule):
# class Module_six_moves_urllib_parse(_LazyModule):
# class Module_six_moves_urllib_error(_LazyModule):
# class Module_six_moves_urllib_request(_LazyModule):
# class Module_six_moves_urllib_response(_LazyModule):
# class Module_six_moves_urllib_robotparser(_LazyModule):
# class Module_six_moves_urllib(types.ModuleType):
#     class Iterator(object):
#             def __len__(self):
# def _add_doc(func, doc):
# def _import_module(name):
#     def __init__(self, name):
#     def __get__(self, obj, tp):
#     def __init__(self, name, old, new=None):
#     def _resolve(self):
#     def __getattr__(self, attr):
#     def __init__(self, name):
#     def __dir__(self):
#     def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
#     def _resolve(self):
#     def __dir__(self):
# def add_move(move):
# def remove_move(name):
#     def advance_iterator(it):
#     def callable(obj):
#     def get_unbound_function(unbound):
#     def get_unbound_function(unbound):
#     def create_bound_method(func, obj):
#         def __next__(self):
# def iterkeys(d, **kw):
# def itervalues(d, **kw):
# def iteritems(d, **kw):
# def iterlists(d, **kw):
#     def b(s):
#     def u(s):
#         def int2byte(i):
#     def b(s):
#     def u(s):
#     def byte2int(bs):
#     def indexbytes(buf, i):
#     def iterbytes(buf):
#     def reraise(tp, value, tb=None):
#     def exec_(_code_, _globs_=None, _locs_=None):
#     def print_(*args, **kwargs):
#         def write(data):
# def with_metaclass(meta, *bases):
# def add_metaclass(metaclass):
#     def wrapper(cls):
# def assertRaisesRegex(self, *args, **kwargs):
# def assertRegex(self, *args, **kwargs):
# 
# Path: arangodb/orm/fields.py
# class UuidField(CharField):
# 
#     def __init__(self, auto_create=True, **kwargs):
#         """
#         """
# 
#         super(UuidField, self).__init__(**kwargs)
# 
#         self.auto_create = auto_create
# 
#     def on_create(self, model_instance):
#         """
#         """
# 
#         if self.auto_create and self.text is None or self.text == '':
#             self.text = str(uuid4())


import unittest
from arangodb import six
from arangodb.orm.fields import UuidField



class UuidFieldTestCase(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_state(self):

        uuid = UuidField()

        self.assertEqual(uuid.text, None)

        uuid.on_create(model_instance=None)


# Path: arangodb/six.py
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
#         MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 63) - 1)
#         class X(object):
# class _LazyDescr(object):
# class MovedModule(_LazyDescr):
# class _LazyModule(types.ModuleType):
# class MovedAttribute(_LazyDescr):
# class _MovedItems(_LazyModule):
# class Module_six_moves_urllib_parse(_LazyModule):
# class Module_six_moves_urllib_error(_LazyModule):
# class Module_six_moves_urllib_request(_LazyModule):
# class Module_six_moves_urllib_response(_LazyModule):
# class Module_six_moves_urllib_robotparser(_LazyModule):
# class Module_six_moves_urllib(types.ModuleType):
#     class Iterator(object):
#             def __len__(self):
# def _add_doc(func, doc):
# def _import_module(name):
#     def __init__(self, name):
#     def __get__(self, obj, tp):
#     def __init__(self, name, old, new=None):
#     def _resolve(self):
#     def __getattr__(self, attr):
#     def __init__(self, name):
#     def __dir__(self):
#     def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
#     def _resolve(self):
#     def __dir__(self):
# def add_move(move):
# def remove_move(name):
#     def advance_iterator(it):
#     def callable(obj):
#     def get_unbound_function(unbound):
#     def get_unbound_function(unbound):
#     def create_bound_method(func, obj):
#         def __next__(self):
# def iterkeys(d, **kw):
# def itervalues(d, **kw):
# def iteritems(d, **kw):
# def iterlists(d, **kw):
#     def b(s):
#     def u(s):
#         def int2byte(i):
#     def b(s):
#     def u(s):
#     def byte2int(bs):
#     def indexbytes(buf, i):
#     def iterbytes(buf):
#     def reraise(tp, value, tb=None):
#     def exec_(_code_, _globs_=None, _locs_=None):
#     def print_(*args, **kwargs):
#         def write(data):
# def with_metaclass(meta, *bases):
# def add_metaclass(metaclass):
#     def wrapper(cls):
# def assertRaisesRegex(self, *args, **kwargs):
# def assertRegex(self, *args, **kwargs):
# 
# Path: arangodb/orm/fields.py
# class UuidField(CharField):
# 
#     def __init__(self, auto_create=True, **kwargs):
#         """
#         """
# 
#         super(UuidField, self).__init__(**kwargs)
# 
#         self.auto_create = auto_create
# 
#     def on_create(self, model_instance):
#         """
#         """
# 
#         if self.auto_create and self.text is None or self.text == '':
#             self.text = str(uuid4())


# Path: arangodb/tests/orm/fields/uuid_field.py
import unittest
from arangodb import six
from arangodb.orm.fields import UuidField




class UuidFieldTestCase(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_state(self):

        uuid = UuidField()

        self.assertEqual(uuid.text, None)

        uuid.on_create(model_instance=None)


        self.assertTrue(isinstance(uuid.text, six.string_types))