# Path: arangodb/orm/fields.py
# class NumberField(ModelField):
# 
#     def __init__(self, **kwargs):
#         """
#         """
# 
#         super(NumberField, self).__init__(**kwargs)
# 
# 
#         # If null is allowed, default value is None
#         if self.null and not self.default:
#             self.number = None
#         else:
#             # If default value was set
#             if self.default:
#                 self.number = self.default
#             else:
#                 self.number = 0
# 
#     def dumps(self):
#         """
#         """
# 
#         return self.number
# 
#     def loads(self, number_val):
#         """
#         """
# 
#         self.number = number_val
# 
#     def validate(self):
#         """
#         """
# 
#         if self.number is None and self.null is False:
#             raise NumberField.NotNullableFieldException()
# 
#     def set(self, *args, **kwargs):
#         """
#         """
# 
#         if len(args) is 1:
#             number = args[0]
# 
#             if isinstance(number, int) or isinstance(number, float):
#                 self.number = args[0]
#             else:
#                 raise NumberField.WrongInputTypeException
# 
#     def get(self):
#         """
#         """
# 
#         return self.number
# 
#     def __eq__(self, other):
#         """
#         """
# 
#         if super(NumberField, self).__eq__(other):
#             return self.number == other.number
#         else:
#             return False


import unittest
from arangodb.orm.fields import NumberField


class NumberFieldTestCase(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_basic_creation_with_default(self):
        number = 122

# Path: arangodb/orm/fields.py
# class NumberField(ModelField):
# 
#     def __init__(self, **kwargs):
#         """
#         """
# 
#         super(NumberField, self).__init__(**kwargs)
# 
# 
#         # If null is allowed, default value is None
#         if self.null and not self.default:
#             self.number = None
#         else:
#             # If default value was set
#             if self.default:
#                 self.number = self.default
#             else:
#                 self.number = 0
# 
#     def dumps(self):
#         """
#         """
# 
#         return self.number
# 
#     def loads(self, number_val):
#         """
#         """
# 
#         self.number = number_val
# 
#     def validate(self):
#         """
#         """
# 
#         if self.number is None and self.null is False:
#             raise NumberField.NotNullableFieldException()
# 
#     def set(self, *args, **kwargs):
#         """
#         """
# 
#         if len(args) is 1:
#             number = args[0]
# 
#             if isinstance(number, int) or isinstance(number, float):
#                 self.number = args[0]
#             else:
#                 raise NumberField.WrongInputTypeException
# 
#     def get(self):
#         """
#         """
# 
#         return self.number
# 
#     def __eq__(self, other):
#         """
#         """
# 
#         if super(NumberField, self).__eq__(other):
#             return self.number == other.number
#         else:
#             return False


# Path: arangodb/tests/orm/fields/number.py
import unittest
from arangodb.orm.fields import NumberField



class NumberFieldTestCase(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_basic_creation_with_default(self):
        number = 122

        field = NumberField(default=number)