diff --git a/phasecalculator/test/iotest/polynomialio_test.py b/phasecalculator/test/iotest/polynomialio_test.py index f873e3923002a07acae051790acfa928986c88d5..d371806ccc197a95d233a85836e138e9110a3809 100755 --- a/phasecalculator/test/iotest/polynomialio_test.py +++ b/phasecalculator/test/iotest/polynomialio_test.py @@ -193,26 +193,16 @@ class PolynomialIOTestCase(unittest.TestCase): [self.binding_file] ) self.assertListEqual([0], results) - exp_file = pandas.read_csv( - self.expected_binding_poly, - sep="\t", - quoting=csv.QUOTE_NONE, - names=list(range(0, 9)), - ) - act_file = pandas.read_csv( - self.actual_binding_poly_file, - sep="\t", - quoting=csv.QUOTE_NONE, - names=list(range(0, 9)), - ) - self.assertTrue(exp_file.columns.equals(act_file.columns)) - self.assertTrue(exp_file.loc[0].equals(act_file.loc[0])) - for i in range(1, exp_file.shape[0]): - self.assertTrue(exp_file.loc[i, :1].equals(act_file.loc[i, :1])) - np.testing.assert_almost_equal( - exp_file.loc[i, 2:].values.astype(float), - act_file.loc[i, 2:].values.astype(float), - ) + with open(self.expected_binding_poly, "r") as exp_poly: + exp_contents = exp_poly.readlines() + with open(self.actual_binding_poly_file) as act_poly: + actual_contents = act_poly.readlines() + self.assertEqual(len(exp_contents), len(actual_contents)) + for i in range(len(exp_contents)): + self.assertEqual( + len(exp_contents[i].split("\t")), + len(actual_contents[i].split("\t")), + ) def test_generate_polynomial_filename(self): """Test expected filename is produced.