FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit afc76eb4 authored by M.D. Driver's avatar M.D. Driver
Browse files

updates due to change in resultsanalysis repository.

parent e6ea0cd3
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -23,6 +23,7 @@ class PolynomialPlottingTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
"""Set up for tests """Set up for tests
""" """
self.maxDiff = None
self.expected_datapoints = solvationenergyreader.parse_binding_energy_from_file_with_data_arrays("resources/water.xml") self.expected_datapoints = solvationenergyreader.parse_binding_energy_from_file_with_data_arrays("resources/water.xml")
self.expected_free_energydatapoints = solvationenergyreader.parse_free_energy_from_file_with_data_arrays("resources/water_freeenergy.xml") self.expected_free_energydatapoints = solvationenergyreader.parse_free_energy_from_file_with_data_arrays("resources/water_freeenergy.xml")
def tearDown(self): def tearDown(self):
...@@ -221,10 +222,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -221,10 +222,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
neg_set_list) neg_set_list)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_write_poly_data_to_file_split_fit(self): def test_write_poly_data_to_file_split_fit(self):
"""Test to see if expected_fit is done on the positive and negative subsets. """Test to see if expected_fit is done on the positive and negative subsets.
""" """
...@@ -237,10 +238,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -237,10 +238,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
neg_set_list) neg_set_list)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_parse_free_energies_and_output_poly_data_subset(self): def test_parse_free_energies_and_output_poly_data_subset(self):
"""Test to see if expected_fit is done on a smaller subset of points. """Test to see if expected_fit is done on a smaller subset of points.
""" """
...@@ -251,10 +252,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -251,10 +252,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
[2, 4], actual_file_name, subset_list) [2, 4], actual_file_name, subset_list)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_parse_binding_energies_and_output_poly_data_subset(self): def test_parse_binding_energies_and_output_poly_data_subset(self):
"""Test to see if expected_fit is done on a smaller subset of points. """Test to see if expected_fit is done on a smaller subset of points.
""" """
...@@ -264,10 +265,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -264,10 +265,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
poly_file_out = polynomialplotting.parse_binding_energies_and_output_poly_data_subset("resources/water.xml", [2, 4], actual_file_name, subset_list) poly_file_out = polynomialplotting.parse_binding_energies_and_output_poly_data_subset("resources/water.xml", [2, 4], actual_file_name, subset_list)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_parse_free_energies_and_output_poly_data(self): def test_parse_free_energies_and_output_poly_data(self):
"""Test to see if expected polynomial fit information is outputted to file. """Test to see if expected polynomial fit information is outputted to file.
""" """
...@@ -277,10 +278,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -277,10 +278,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
[2, 4], actual_file_name) [2, 4], actual_file_name)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_parse_binding_energies_and_output_poly_data(self): def test_parse_binding_energies_and_output_poly_data(self):
"""Test to see if expected polynomial fit information is outputted to file. """Test to see if expected polynomial fit information is outputted to file.
""" """
...@@ -289,10 +290,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -289,10 +290,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
poly_file_out = polynomialplotting.parse_binding_energies_and_output_poly_data("resources/water.xml", [2, 4], actual_file_name) poly_file_out = polynomialplotting.parse_binding_energies_and_output_poly_data("resources/water.xml", [2, 4], actual_file_name)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_write_poly_data_to_file(self): def test_write_poly_data_to_file(self):
"""Test to see if expected polynomial fit data is written to file. """Test to see if expected polynomial fit data is written to file.
""" """
...@@ -302,10 +303,10 @@ class PolynomialPlottingTestCase(unittest.TestCase): ...@@ -302,10 +303,10 @@ class PolynomialPlottingTestCase(unittest.TestCase):
[2, 4], actual_file_name) [2, 4], actual_file_name)
self.assertEqual(0, poly_file_out) self.assertEqual(0, poly_file_out)
with open(expected_file_name, 'r') as exp_file: with open(expected_file_name, 'r') as exp_file:
exp_file_lines = exp_file.readlines() exp_file_lines = exp_file.read()
with open(actual_file_name, 'r') as act_file: with open(actual_file_name, 'r') as act_file:
act_file_lines = act_file.readlines() act_file_lines = act_file.read()
self.assertListEqual(act_file_lines, exp_file_lines) self.assertMultiLineEqual(act_file_lines, exp_file_lines)
def test_parse_free_energy_from_file_with_data_arrays(self): def test_parse_free_energy_from_file_with_data_arrays(self):
"""Test to see if expected datapoints are read in. """Test to see if expected datapoints are read in.
""" """
......
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