FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit ca9472ed authored by Mark Driver's avatar Mark Driver
Browse files

doc and test clean up updates.

parent 60e3ce79
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ import unittest
import pandas
import pathlib
import numpy as np
import os
import phasecalculator.analysis.similarityanalysis as simanalysis
......@@ -61,8 +62,18 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
None.
"""
del self.expected_free_poly
del self.expected_matrix_file
del self.example_with_pure_data
del self.example_matrix
if os.path.isfile(self.actual_matrix_file):
os.remove(self.actual_matrix_file)
if os.path.isfile(self.actual_series_file):
os.remove(self.actual_series_file)
del self.actual_matrix_file
del self.actual_series_file
def test_read_polynomial_files(self):
"""Test
"""Test expected information is read.
Returns
-------
......@@ -90,7 +101,7 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
else:
self.assertEqual(value, expected_dict['resourcesexpected,parsed'][8][region][key])
def test_compare_all_solvents(self):
"""Test
"""Test complete matrix is produced.
Returns
-------
......@@ -102,7 +113,7 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
actual_dataframe = pandas.read_csv(self.actual_matrix_file, sep="\t",header=0,index_col=0)
self.assertEqual((262,262), actual_dataframe.shape)
def test_compare_with_pure_solvents(self):
"""Test
"""Test column matrix is produced.
Returns
-------
......@@ -115,7 +126,7 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
actual_dataframe = pandas.read_csv(self.actual_series_file, sep="\t",header=0,index_col=0)
self.assertEqual((261,1), actual_dataframe.shape)
def test_compare_solvent_list(self):
"""Test
"""Test expected matrix is produced.
Returns
-------
......@@ -127,7 +138,7 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
actual_dataframe = pandas.read_csv(self.actual_matrix_file, sep="\t",header=0,index_col=0)
self.assertEqual((1,1), actual_dataframe.shape)
def test_write_frame_to_file(self):
"""Test
"""Test expected file is exists.
Returns
-------
......@@ -137,7 +148,7 @@ class SimilarityAnalysisTestCase(unittest.TestCase):
simanalysis.write_frame_to_file(self.example_matrix, self.actual_matrix_file)
self.assertTrue(pathlib.Path(self.actual_matrix_file).is_file())
def test_extract_comparison_to_pure_solvents(self):
"""Test
"""Test expected comparisons are produced.
Returns
-------
......
......@@ -23,6 +23,7 @@ Test case for System Collection Processor methods.
import logging
import unittest
from lxml import etree
import os
from phasecalculator.classes.temperature import Temperature
from phasecalculator.classes.molecule import Molecule
from phasecalculator.classes.phase import Phase
......@@ -75,8 +76,11 @@ class SystemCollectionProcessorTestCase(unittest.TestCase):
del self.out_inf
del self.system
del self.system_collection
if os.path.isfile(self.xml_filename):
os.remove(self.xml_filename)
del self.xml_filename
def test_read_system_collection_file(self):
"""Test
"""Test expected collection is read in
Returns
-------
......@@ -86,7 +90,7 @@ class SystemCollectionProcessorTestCase(unittest.TestCase):
actual_sys_collection = sysproc.read_system_collection_file(self.xml_filename)
self.assertEqual(self.system_collection, actual_sys_collection)
def test_write_system_collection_file(self):
"""Test
"""Test file contents produced as expected.
Returns
-------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment