# Path: auxi/core/bibliography.py
# class Database(object):
#     """
#     A bibliography database that contains and provides entries in a bibtex
#     file.
# 
#     :param path: the path to the bibtex file to load into the database
#     """
# 
#     def __init__(self, path):
#         with open(path) as file:
#             bibtex_str = file.read()
# 
#         bib_database = bibtexparser.loads(bibtex_str)
#         self._dict = bib_database.get_entry_dict()
# 
#     def __str__(self):
#         return str(self._dict)
# 
#     def __getitem__(self, key):
#         return self._dict[key]


import unittest
from os import path
from auxi.core.bibliography import Database as testee

__version__ = '0.3.6'
__license__ = 'LGPL v3'
__copyright__ = 'Copyright 2016, Ex Mente Technologies (Pty) Ltd'
__author__ = 'Johan Zietsman'
__credits__ = ['Johan Zietsman']
__maintainer__ = 'Johan Zietsman'
__email__ = 'johan.zietsman@ex-mente.co.za'
__status__ = 'Planning'


class DatabaseTester(unittest.TestCase):
    """
    The function tester for the bibliography Database class.
    """

    def test_construct(self):
        """
        Test whether an exception is raised when a database object is created
        from a bibtex file.
        """

        testee(path.join(path.dirname(path.realpath(__file__)),
               'data/bibliography.bib'))

    def test_entry(self):
        """
        Test whether an entry is successfully retrieved from the database.
        """


# Path: auxi/core/bibliography.py
# class Database(object):
#     """
#     A bibliography database that contains and provides entries in a bibtex
#     file.
# 
#     :param path: the path to the bibtex file to load into the database
#     """
# 
#     def __init__(self, path):
#         with open(path) as file:
#             bibtex_str = file.read()
# 
#         bib_database = bibtexparser.loads(bibtex_str)
#         self._dict = bib_database.get_entry_dict()
# 
#     def __str__(self):
#         return str(self._dict)
# 
#     def __getitem__(self, key):
#         return self._dict[key]


# Path: auxi/core/bibliography_test.py
import unittest
from os import path
from auxi.core.bibliography import Database as testee


__version__ = '0.3.6'
__license__ = 'LGPL v3'
__copyright__ = 'Copyright 2016, Ex Mente Technologies (Pty) Ltd'
__author__ = 'Johan Zietsman'
__credits__ = ['Johan Zietsman']
__maintainer__ = 'Johan Zietsman'
__email__ = 'johan.zietsman@ex-mente.co.za'
__status__ = 'Planning'


class DatabaseTester(unittest.TestCase):
    """
    The function tester for the bibliography Database class.
    """

    def test_construct(self):
        """
        Test whether an exception is raised when a database object is created
        from a bibtex file.
        """

        testee(path.join(path.dirname(path.realpath(__file__)),
               'data/bibliography.bib'))

    def test_entry(self):
        """
        Test whether an entry is successfully retrieved from the database.
        """


        db = testee(path.join(path.dirname(path.realpath(__file__)),