Example #1
0
    def test_find_none(self):
        """
        Given a directory with no sequencing run directories in it, make sure an empty list is returned
        :return:
        """
        directory = os.path.join(path_to_module, "no_dirs")
        res = common.find_directory_list(directory)

        self.assertEqual(res, [])
Example #2
0
    def test_find_three(self):
        """
        Given a directory with 3 run directories in it, make sure all 3 directories are included in result
        :return:
        """
        directory = os.path.join(path_to_module, "three_dirs")
        dir_1 = os.path.join(directory, "first")
        dir_2 = os.path.join(directory, "second")
        dir_3 = os.path.join(directory, "third")
        res = common.find_directory_list(directory)

        self.assertIn(dir_1, res)
        self.assertIn(dir_2, res)
        self.assertIn(dir_3, res)
Example #3
0
    def find_runs(self, directory):
        """
        find a list of run directories in the directory given

        :param directory:
        :return: list of DirectoryStatus objects
        """
        logging.info("looking for runs in {}".format(directory))

        runs = []
        directory_list = common.find_directory_list(directory)
        for d in directory_list:
            runs.append(progress.get_directory_status(d, self.get_required_file_list()))

        return runs