def _key_image_path_for(key): key_images_path = os.path.join(common.get_project_base_path(), 'resources', 'key_images') for key_filename in os.listdir(key_images_path): basename, _ = os.path.splitext(key_filename) if basename.lower().endswith("_".join(key.split())): return os.path.join(key_images_path, key_filename) assert False, "Key '%s' not found in %s" % (key, os.listdir(key_images_path))
def setUp(self): super(BaseTestCase, self).setUp() self.temp_dir = tempfile.mkdtemp(prefix="stc_") class_name, testcase_name = self.id().split(".")[-2:] assert class_name is not None and testcase_name is not None self.__testresult_base_path = os.path.join(common.get_project_base_path(), "testresult", class_name, testcase_name) if os.path.exists(self.__testresult_base_path): shutil.rmtree(self.__testresult_base_path) self.__testresult_folder_subdir = None
def get_test_resources_path(*path_parts): return os.path.join(common.get_project_base_path(), "test", "res", *path_parts)
def __init__(self, *args): super(MainTest, self).__init__(*args) self._main_method = main.run_converter self.base_exec_args = ["python", os.path.join(common.get_project_base_path(), "run.py")]