def test_find_dir(self): """ Given a valid run directory, show as new :return: """ directory = path.join(path_to_module, "three_dirs", "first") res = Parser.find_single_run(directory) self.assertEqual(type(res), model.DirectoryStatus) self.assertEqual(res.status, "new") self.assertEqual(res.directory, directory)
def test_find_in_dir_with_three_dirs(self): """ Given a directory with directories in it (but no actual run at highest level), show as invalid :return: """ directory = path.join(path_to_module, "three_dirs") res = Parser.find_single_run(directory) self.assertEqual(type(res), model.DirectoryStatus) self.assertEqual(res.status, "invalid") self.assertEqual(res.directory, directory)
def test_find_none(self): """ Given a directory with nothing in it, show as invalid :return: """ directory = path.join(path_to_module, "no_dirs") res = Parser.find_single_run(directory) self.assertEqual(type(res), model.DirectoryStatus) self.assertEqual(res.status, "invalid") self.assertEqual(res.directory, directory)
def test_find_dir_no_completed_file(self): """ Given a run directory with no run completed file, show as invalid :return: """ directory = path.join(path_to_module, "fake_ngs_data_no_completed") res = Parser.find_single_run(directory) self.assertEqual(type(res), model.DirectoryStatus) self.assertEqual(res.status, "invalid") self.assertEqual(res.directory, directory)