def test_find_csv_edge(self): """This function tests that an exception is raised if the function is passed the wrong file extension """ self.assertRaises(Exception, mv.find_csv_filenames(mv.data_path, ".html"))
def test_find_csv_2(self): """This function tests that the function returns the corrcet filename""" if not os.path.isdir("movie_analysis/tests/test1"): os.mkdir("movie_analysis/tests/test1") f = open("movie_analysis/tests/test1/testing.csv", "w+") f.close() self.assertTrue( mv.find_csv_filenames("movie_analysis/tests/test1", ".csv"), ["testing.csv"])
def test_find_csv_oneshot(self): """This function tests that the list of filenames returned is not empty""" self.assertFalse( len(mv.find_csv_filenames(mv.data_path, suffix=".csv")) == 0)