Пример #1
0
def exec_util(main: str, args: str = ""):
    base_path = dirname(__file__)
    utils_jar_path = join(base_path, UTILS_JAR_NAME)

    if exists(utils_jar_path) and not is_valid_file(utils_jar_path, UTILS_MD5):
        remove(utils_jar_path)

    if not exists(utils_jar_path):
        try:
            download_file(UTILS_JAR_URL, utils_jar_path, UTILS_MD5)
        except (URLError, ValueError, FileNotFoundError) as e:
            raise ValueError("utils unavailable: {}".format(e))

    return Shell.exec('java -cp "{}" de.tu_darmstadt.stg.mubench.utils.{} {}'.format(utils_jar_path, main, args))
Пример #2
0
    def test_is_valid(self):
        create_file(self.file)

        assert is_valid_file(self.file)
Пример #3
0
 def test_is_invalid(self):
     assert not is_valid_file(self.file)