aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_filter.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-10-21 15:38:10 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commitb404312686874e539b617d1f27ccbaa5a82936af (patch)
treec2fdb2cc046e6da53071629cd1750dcc327e6cd9 /test/test_filter.py
parentd4aec28ba8ad24d5aef3ee12beeb1b805148eab1 (diff)
downloadserd-b404312686874e539b617d1f27ccbaa5a82936af.tar.gz
serd-b404312686874e539b617d1f27ccbaa5a82936af.tar.bz2
serd-b404312686874e539b617d1f27ccbaa5a82936af.zip
Replace serdi with more fine-grained tools
Especially with the new functionality, the complexity of the command-line interface alone was really becoming unmanageable. The serdi implementation also had the highest cyclomatic complexity of the entire codebase by a huge margin. So, take a page from the Unix philosophy and split serdi into several more finely-honed tools that can be freely composed. Though there is still unfortunately quite a bit of option overlap between them due to the common details of reading RDF, I think the resulting tools are a lot easier to understand, both from a user and a developer perspective.
Diffstat (limited to 'test/test_filter.py')
-rwxr-xr-xtest/test_filter.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_filter.py b/test/test_filter.py
index d44677f5..5f25f22e 100755
--- a/test/test_filter.py
+++ b/test/test_filter.py
@@ -21,7 +21,7 @@ DOCUMENTS = {
parser = argparse.ArgumentParser(description=__doc__)
-parser.add_argument("--serdi", default="./serdi", help="path to serdi")
+parser.add_argument("--tool", default="tools/serd-filter", help="executable")
parser.add_argument("--wrapper", default="", help="executable wrapper")
args = parser.parse_args(sys.argv[1:])
@@ -29,21 +29,21 @@ args = parser.parse_args(sys.argv[1:])
def check_pattern(syntax, pattern, result):
command = shlex.split(args.wrapper) + [
- args.serdi,
- "-i",
+ args.tool,
+ "-I",
syntax,
- "-F",
+ "-v",
pattern,
- "-s",
- DOCUMENTS[syntax],
+ "-",
]
with tempfile.TemporaryFile() as out:
proc = subprocess.run(
command,
+ capture_output=True,
check=False,
encoding="utf-8",
- capture_output=True,
+ input=DOCUMENTS[syntax],
)
assert proc.returncode == 0