# Path: g_sorcery/g_collections.py
# class serializable_elist(object):
#     """
#     A JSON serializable version of elist.
#     """
# 
#     __slots__ = ('data')
# 
#     def __init__(self, iterable=None, separator=' '):
#         '''
#         iterable: initialize from iterable's items
#         separator: string used to join list members with for __str__()
#         '''
#         self.data = elist(iterable or [], separator)
# 
#     def __eq__(self, other):
#         return self.data == other.data
# 
#     def __iter__(self):
#         return iter(self.data)
# 
#     def __str__(self):
#         '''Custom output function
#         '''
#         return str(self.data)
# 
#     def append(self, x):
#         self.data.append(x)
# 
#     def serialize(self):
#         return {"separator": self.data._sep_, "data" : self.data}
# 
#     @classmethod
#     def deserialize(cls, value):
#         return serializable_elist(value["data"], separator = value["separator"])
# 
# Path: tests/base.py
# class BaseTest(unittest.TestCase):
# 
#     def setUp(self):
#         self.tempdir = TemporaryDirectory()
# 
#     def tearDown(self):
#         del self.tempdir
# 
# Path: tests/serializable.py
# class NonSerializableClass(object):
#     pass
# 
# class SerializableClass(object):
# 
#     __slots__ = ("field1", "field2")
# 
#     def __init__(self, field1, field2):
#         self.field1 = field1
#         self.field2 = field2
# 
#     def __eq__(self, other):
#         return self.field1 == other.field1 \
#           and self.field2 == other.field2
# 
#     def serialize(self):
#         return {"field1": self.field1, "field2": self.field2}
# 
# class DeserializableClass(SerializableClass):
# 
#     @classmethod
#     def deserialize(cls, value):
#         return DeserializableClass(value["field1"], value["field2"])


import os
import unittest
from g_sorcery.g_collections import serializable_elist
from tests.base import BaseTest
from tests.serializable import NonSerializableClass, SerializableClass, DeserializableClass
    from g_sorcery.file_bson.file_bson import FileBSON
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
    test_FileBSON.py
    ~~~~~~~~~~~~~~~~

    FileBSON test suite

    :copyright: (c) 2013-2015 by Jauhien Piatlicki
    :license: GPL-2, see LICENSE for more details.
"""




BSON_INSTALLED = False

try:
    BSON_INSTALLED = True
except ImportError as e:
    pass

if BSON_INSTALLED:


# Path: g_sorcery/g_collections.py
# class serializable_elist(object):
#     """
#     A JSON serializable version of elist.
#     """
# 
#     __slots__ = ('data')
# 
#     def __init__(self, iterable=None, separator=' '):
#         '''
#         iterable: initialize from iterable's items
#         separator: string used to join list members with for __str__()
#         '''
#         self.data = elist(iterable or [], separator)
# 
#     def __eq__(self, other):
#         return self.data == other.data
# 
#     def __iter__(self):
#         return iter(self.data)
# 
#     def __str__(self):
#         '''Custom output function
#         '''
#         return str(self.data)
# 
#     def append(self, x):
#         self.data.append(x)
# 
#     def serialize(self):
#         return {"separator": self.data._sep_, "data" : self.data}
# 
#     @classmethod
#     def deserialize(cls, value):
#         return serializable_elist(value["data"], separator = value["separator"])
# 
# Path: tests/base.py
# class BaseTest(unittest.TestCase):
# 
#     def setUp(self):
#         self.tempdir = TemporaryDirectory()
# 
#     def tearDown(self):
#         del self.tempdir
# 
# Path: tests/serializable.py
# class NonSerializableClass(object):
#     pass
# 
# class SerializableClass(object):
# 
#     __slots__ = ("field1", "field2")
# 
#     def __init__(self, field1, field2):
#         self.field1 = field1
#         self.field2 = field2
# 
#     def __eq__(self, other):
#         return self.field1 == other.field1 \
#           and self.field2 == other.field2
# 
#     def serialize(self):
#         return {"field1": self.field1, "field2": self.field2}
# 
# class DeserializableClass(SerializableClass):
# 
#     @classmethod
#     def deserialize(cls, value):
#         return DeserializableClass(value["field1"], value["field2"])


# Path: tests/test_FileBSON.py
import os
import unittest
from g_sorcery.g_collections import serializable_elist
from tests.base import BaseTest
from tests.serializable import NonSerializableClass, SerializableClass, DeserializableClass
    from g_sorcery.file_bson.file_bson import FileBSON

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
    test_FileBSON.py
    ~~~~~~~~~~~~~~~~

    FileBSON test suite

    :copyright: (c) 2013-2015 by Jauhien Piatlicki
    :license: GPL-2, see LICENSE for more details.
"""




BSON_INSTALLED = False

try:
    BSON_INSTALLED = True
except ImportError as e:
    pass

if BSON_INSTALLED:


    class TestFileJSON(BaseTest):