Exemple #1
0
 def test_save_to_disk(self):
     util.save_to_disk(self.nicks, current_directory + "/data/nicksTest")
     status, output = commands.getstatusoutput('cmp ' + current_directory +
                                               '/data/nicks ' +
                                               current_directory +
                                               '/data/nicksTest')
     subprocess.Popen(['rm', current_directory + '/data/nicksTest'])
     assert status == 0, "Failure to load from disk."
    def test_calc_plot_linear_fit(self, x_in, y_in, expected_result):

        output = vis.calc_plot_linear_fit(x_in, y_in, current_dir,
                                          "linear_plot_test")
        util.save_to_disk(output, current_dir + "/out-check")
        #remove the image generated from plot function
        os.remove(current_dir + '/linear_plot_test.png')

        assert np.allclose(output, expected_result)