# Path: tilde/core/api.py
# API = TildeAPI
# 
# Path: tilde/core/settings.py
# BASE_DIR = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
# 
# EXAMPLE_DIR = os.path.join(ROOT_DIR, '../tests/data')


import os, sys
import unittest
from tilde.core.api import API
from tilde.core.settings import BASE_DIR, EXAMPLE_DIR




class Test_API(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.sample = API()

    def test_count_classifiers(self):
        available_classifiers = []
        path = os.path.realpath(BASE_DIR + '/../classifiers')
        for classifierpath in os.listdir(path):
            if os.path.isfile(os.path.join(path, classifierpath)) and classifierpath.endswith('.py') and classifierpath != '__init__.py':
                available_classifiers.append(classifierpath)

        self.assertEqual(len(self.sample.Classifiers), len(available_classifiers),
            "Expected to have %s, but got %s modules. May be unused classifier occured since?" % (len(available_classifiers), len(self.sample.Classifiers)))

    def test_formula(self):
        self.assertEqual(self.sample.formula(['H', 'O', 'C', 'H', 'H', 'C', 'H', 'H', 'H' ]), 'C2H6O', "Formula was errorneously generated!")

    def test_savvyize_simple(self):

# Path: tilde/core/api.py
# API = TildeAPI
# 
# Path: tilde/core/settings.py
# BASE_DIR = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
# 
# EXAMPLE_DIR = os.path.join(ROOT_DIR, '../tests/data')


# Path: tests/unit/api_test.py
import os, sys
import unittest
from tilde.core.api import API
from tilde.core.settings import BASE_DIR, EXAMPLE_DIR





class Test_API(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.sample = API()

    def test_count_classifiers(self):
        available_classifiers = []
        path = os.path.realpath(BASE_DIR + '/../classifiers')
        for classifierpath in os.listdir(path):
            if os.path.isfile(os.path.join(path, classifierpath)) and classifierpath.endswith('.py') and classifierpath != '__init__.py':
                available_classifiers.append(classifierpath)

        self.assertEqual(len(self.sample.Classifiers), len(available_classifiers),
            "Expected to have %s, but got %s modules. May be unused classifier occured since?" % (len(available_classifiers), len(self.sample.Classifiers)))

    def test_formula(self):
        self.assertEqual(self.sample.formula(['H', 'O', 'C', 'H', 'H', 'C', 'H', 'H', 'H' ]), 'C2H6O', "Formula was errorneously generated!")

    def test_savvyize_simple(self):

        path = os.path.join(EXAMPLE_DIR, 'CRYSTAL')