def test_local_plugin_not_directory(cli, datafiles): project = str(datafiles) path = os.path.join(project, "plugins") for _file_type in filetypegenerator.generate_file_types(path): result = cli.run(project=project, args=["workspace", "list"]) if not os.path.isdir(path): result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.PROJ_PATH_INVALID_KIND) else: result.assert_success()
def test_non_regular_file_patch(cli, datafiles): project = str(datafiles) patch_path = os.path.join(project, "irregular_file.patch") for _file_type in filetypegenerator.generate_file_types(patch_path): result = cli.run(project=project, args=["show", "irregular.bst"]) if os.path.isfile(patch_path) and not os.path.islink(patch_path): result.assert_success() else: result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.PROJ_PATH_INVALID_KIND)
def test_non_regular_file_or_directory(cli, datafiles): project = str(datafiles) localfile = os.path.join(project, "file.txt") for _file_type in filetypegenerator.generate_file_types(localfile): result = cli.run(project=project, args=["show", "target.bst"]) if os.path.isdir(localfile) and not os.path.islink(localfile): result.assert_success() elif os.path.isfile(localfile) and not os.path.islink(localfile): result.assert_success() else: result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.PROJ_PATH_INVALID_KIND)