# Path: auxi/tools/materialphysicalproperties/core.py
# class StateOfMatter(Enum):
# class DataSet(object):
# class Model(Object):
#     def create_template(material, path, show=False):
#     def __init__(self, csvfilepath):
#     def __str__(self):
#     def _read_header_information(self):
#     def _read_data(self):
#     def __init__(self, material, property, symbol, display_symbol, units,
#                  state_schema, references, datasets):
#     def __call__(self, **state):
#     def _create_validator(self, state_schema):
#     def calculate(self, **state):


import unittest
import csv
from os import remove
from os.path import realpath, dirname, join, isfile
from auxi.tools.materialphysicalproperties import core as testee
    def test_create_template(self):
        mat_name = 'test'
        template_path = MODULE_PATH
        testee.DataSet.create_template(mat_name, template_path)
        file_path = join(MODULE_PATH, 'dataset-%s.csv' % mat_name)
        self.assertTrue(isfile(file_path))

        with open(file_path, newline='') as file:
            lines = csv.reader(file, delimiter=',', quotechar='"')
            ix = 0
            for l in lines:
                if ix == 0:
                    self.assertEqual(l[0], 'Name')
                    self.assertEqual(l[1], 'test')
                if ix == 7:
                    self.assertEqual(l[0], '100.0')
                    self.assertEqual(l[1], '0.0')
                    self.assertEqual(l[2], '10.0')
                    self.assertEqual(l[3], '100.0')
                if ix == 16:
                    self.assertEqual(l[0], '550.0')
                    self.assertEqual(l[1], '9.0')
                    self.assertEqual(l[2], '19.0')
                    self.assertEqual(l[3], '109.0')
                ix += 1
        remove(file_path)

    def _create_dataset(self):
        path = join(dirname(realpath(__file__)),
                    'data/dataset-air-lienhard2015.csv')

# Path: auxi/tools/materialphysicalproperties/core.py
# class StateOfMatter(Enum):
# class DataSet(object):
# class Model(Object):
#     def create_template(material, path, show=False):
#     def __init__(self, csvfilepath):
#     def __str__(self):
#     def _read_header_information(self):
#     def _read_data(self):
#     def __init__(self, material, property, symbol, display_symbol, units,
#                  state_schema, references, datasets):
#     def __call__(self, **state):
#     def _create_validator(self, state_schema):
#     def calculate(self, **state):


# Path: auxi/tools/materialphysicalproperties/core_test.py
import unittest
import csv
from os import remove
from os.path import realpath, dirname, join, isfile
from auxi.tools.materialphysicalproperties import core as testee

    def test_create_template(self):
        mat_name = 'test'
        template_path = MODULE_PATH
        testee.DataSet.create_template(mat_name, template_path)
        file_path = join(MODULE_PATH, 'dataset-%s.csv' % mat_name)
        self.assertTrue(isfile(file_path))

        with open(file_path, newline='') as file:
            lines = csv.reader(file, delimiter=',', quotechar='"')
            ix = 0
            for l in lines:
                if ix == 0:
                    self.assertEqual(l[0], 'Name')
                    self.assertEqual(l[1], 'test')
                if ix == 7:
                    self.assertEqual(l[0], '100.0')
                    self.assertEqual(l[1], '0.0')
                    self.assertEqual(l[2], '10.0')
                    self.assertEqual(l[3], '100.0')
                if ix == 16:
                    self.assertEqual(l[0], '550.0')
                    self.assertEqual(l[1], '9.0')
                    self.assertEqual(l[2], '19.0')
                    self.assertEqual(l[3], '109.0')
                ix += 1
        remove(file_path)

    def _create_dataset(self):
        path = join(dirname(realpath(__file__)),
                    'data/dataset-air-lienhard2015.csv')

        return testee.DataSet(path)