# Path: arangodb/api.py
# class Document(object):
#     @classmethod
#     def create(cls, collection):
#         """
#             Creates document object without really creating it in the collection.
# 
#             :param collection Collection instance
# 
#             :returns Document
#         """
# 
#         api = Client.instance().api
# 
#         doc = Document(
#             id='',
#             key='',
#             collection=collection.name,
#             api=api,
#         )
# 
#         return doc
# 
#     def __init__(self, id, key, collection, api, **kwargs):
#         """
#             :param id Document id (collection_name/number)
#             :param key Document key (number)
#             :param collection Collection name
#             :param api Slumber API object
# 
#             :param rev Document revision, default value is key
#         """
# 
#         self.data = {}
#         self.is_loaded = False
# 
#         self.id = id
#         self.key = key
#         self.revision = kwargs.pop('rev', key)
#         self.collection = collection
#         self.api = api
#         self.resource = api.document
# 
# 
#     def retrieve(self):
#         """
#             Retrieves all data for this document and saves it.
#         """
# 
#         data = self.resource(self.id).get()
#         self.data = data
# 
#         return data
# 
#     def delete(self):
#         """
#             Removes the document from the collection
#         """
# 
#         self.resource(self.id).delete()
# 
#     def save(self):
#         """
#             If its internal state is loaded than it will only updated the
#             set properties but otherwise it will create a new document.
#         """
# 
#         # TODO: Add option force_insert
# 
#         if not self.is_loaded and self.id is None or self.id == '':
#             data = self.resource.post(data=self.data, collection=self.collection)
#             self.id = data['_id']
#             self.key = data['_key']
#             self.revision = data['_rev']
#             self.is_loaded = True
#         else:
#             data = self.resource(self.id).patch(data=self.data)
#             self.revision = data['_rev']
# 
#     def get(self, key):
#         """
#             Returns attribute value.
# 
#             :param key
# 
#             :returns value
#         """
# 
#         if not self.is_loaded:
#             self.retrieve()
# 
#             self.is_loaded = True
# 
#         if self.has(key=key):
#             return self.data[key]
#         else:
#             return None
# 
#     def set(self, key, value):
#         """
#             Sets document value
# 
#             :param key
#             :param value
#         """
# 
#         self.data[key] = value
# 
#     def has(self, key):
#         """
#             Returns if the document has a attribute with the name key
#         """
# 
#         return key in self.data
# 
#     def get_attributes(self):
#         """
#             Return dict with all attributes
#         """
# 
#         return self.data
# 
#     def __getattr__(self, item):
#         """
#         """
# 
#         val = self.get(key=item)
#         return val
# 
#     def __setattr__(self, key, value):
#         """
#         """
# 
#         # Set internal variables normally
#         if key in ['data', 'is_loaded', 'id', 'key', 'revision', 'collection', 'api', 'resource']:
#             super(Document, self).__setattr__(key, value)
#         else:
#             self.set(key=key, value=value)
# 
#     def __repr__(self):
#         """
#         """
#         return self.__str__()
# 
#     def __str__(self):
#         return self.__unicode__()
# 
#     def __unicode__(self):
#         return "%s" % self.id
# 
# Path: arangodb/tests/base.py
# class ExtendedTestCase(unittest.TestCase):
#     def assertDocumentsEqual(self, doc1, doc2):


import unittest
from arangodb.api import Document
from arangodb.tests.base import client


class DocumentTestCase(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_document_access_values_by_attribute_getter(self):

# Path: arangodb/api.py
# class Document(object):
#     @classmethod
#     def create(cls, collection):
#         """
#             Creates document object without really creating it in the collection.
# 
#             :param collection Collection instance
# 
#             :returns Document
#         """
# 
#         api = Client.instance().api
# 
#         doc = Document(
#             id='',
#             key='',
#             collection=collection.name,
#             api=api,
#         )
# 
#         return doc
# 
#     def __init__(self, id, key, collection, api, **kwargs):
#         """
#             :param id Document id (collection_name/number)
#             :param key Document key (number)
#             :param collection Collection name
#             :param api Slumber API object
# 
#             :param rev Document revision, default value is key
#         """
# 
#         self.data = {}
#         self.is_loaded = False
# 
#         self.id = id
#         self.key = key
#         self.revision = kwargs.pop('rev', key)
#         self.collection = collection
#         self.api = api
#         self.resource = api.document
# 
# 
#     def retrieve(self):
#         """
#             Retrieves all data for this document and saves it.
#         """
# 
#         data = self.resource(self.id).get()
#         self.data = data
# 
#         return data
# 
#     def delete(self):
#         """
#             Removes the document from the collection
#         """
# 
#         self.resource(self.id).delete()
# 
#     def save(self):
#         """
#             If its internal state is loaded than it will only updated the
#             set properties but otherwise it will create a new document.
#         """
# 
#         # TODO: Add option force_insert
# 
#         if not self.is_loaded and self.id is None or self.id == '':
#             data = self.resource.post(data=self.data, collection=self.collection)
#             self.id = data['_id']
#             self.key = data['_key']
#             self.revision = data['_rev']
#             self.is_loaded = True
#         else:
#             data = self.resource(self.id).patch(data=self.data)
#             self.revision = data['_rev']
# 
#     def get(self, key):
#         """
#             Returns attribute value.
# 
#             :param key
# 
#             :returns value
#         """
# 
#         if not self.is_loaded:
#             self.retrieve()
# 
#             self.is_loaded = True
# 
#         if self.has(key=key):
#             return self.data[key]
#         else:
#             return None
# 
#     def set(self, key, value):
#         """
#             Sets document value
# 
#             :param key
#             :param value
#         """
# 
#         self.data[key] = value
# 
#     def has(self, key):
#         """
#             Returns if the document has a attribute with the name key
#         """
# 
#         return key in self.data
# 
#     def get_attributes(self):
#         """
#             Return dict with all attributes
#         """
# 
#         return self.data
# 
#     def __getattr__(self, item):
#         """
#         """
# 
#         val = self.get(key=item)
#         return val
# 
#     def __setattr__(self, key, value):
#         """
#         """
# 
#         # Set internal variables normally
#         if key in ['data', 'is_loaded', 'id', 'key', 'revision', 'collection', 'api', 'resource']:
#             super(Document, self).__setattr__(key, value)
#         else:
#             self.set(key=key, value=value)
# 
#     def __repr__(self):
#         """
#         """
#         return self.__str__()
# 
#     def __str__(self):
#         return self.__unicode__()
# 
#     def __unicode__(self):
#         return "%s" % self.id
# 
# Path: arangodb/tests/base.py
# class ExtendedTestCase(unittest.TestCase):
#     def assertDocumentsEqual(self, doc1, doc2):


# Path: arangodb/tests/api/document.py
import unittest
from arangodb.api import Document
from arangodb.tests.base import client



class DocumentTestCase(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_document_access_values_by_attribute_getter(self):

        doc = Document(id='', key='', collection='', api=client.api)