Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_cli.py
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | def test_cli_mapping_list(cli_runner, swh_config): | ||||
) | ) | ||||
expected_output = "\n".join( | expected_output = "\n".join( | ||||
[ | [ | ||||
"cff", | "cff", | ||||
"codemeta", | "codemeta", | ||||
"composer", | "composer", | ||||
"gemspec", | "gemspec", | ||||
"github", | "github", | ||||
"json-sword-codemeta", | |||||
"maven", | "maven", | ||||
"npm", | "npm", | ||||
"nuget", | "nuget", | ||||
"pkg-info", | "pkg-info", | ||||
"pubspec", | "pubspec", | ||||
"sword-codemeta", | "sword-codemeta", | ||||
"", | "", | ||||
] # must be sorted for test to pass | ] # must be sorted for test to pass | ||||
Show All 23 Lines | result = cli_runner.invoke( | ||||
[ | [ | ||||
"-C", | "-C", | ||||
swh_config, | swh_config, | ||||
"mapping", | "mapping", | ||||
"list-terms", | "list-terms", | ||||
"--exclude-mapping", | "--exclude-mapping", | ||||
"codemeta", | "codemeta", | ||||
"--exclude-mapping", | "--exclude-mapping", | ||||
"json-sword-codemeta", | |||||
"--exclude-mapping", | |||||
"sword-codemeta", | "sword-codemeta", | ||||
], | ], | ||||
catch_exceptions=False, | catch_exceptions=False, | ||||
) | ) | ||||
assert result.exit_code == 0, result.output | assert result.exit_code == 0, result.output | ||||
assert re.search(r"http://schema.org/url:\n.*npm", result.output) | assert re.search(r"http://schema.org/url:\n.*npm", result.output) | ||||
assert not re.search(r"http://schema.org/url:\n.*codemeta", result.output) | assert not re.search(r"http://schema.org/url:\n.*codemeta", result.output) | ||||
assert not re.search( | assert not re.search( | ||||
▲ Show 20 Lines • Show All 759 Lines • Show Last 20 Lines |