aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_multifile.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-03-29 23:34:40 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit4e1850852a74fe6904beabf793ea8d9915cab246 (patch)
tree5fff5fb4aa6161d7e69434e6d3ca587a971c35ea /test/test_multifile.py
parent5796f49ec8ff1933f4a3c258c16f140b39cc1c03 (diff)
downloadserd-4e1850852a74fe6904beabf793ea8d9915cab246.tar.gz
serd-4e1850852a74fe6904beabf793ea8d9915cab246.tar.bz2
serd-4e1850852a74fe6904beabf793ea8d9915cab246.zip
Add support for reading multiple files at once
Diffstat (limited to 'test/test_multifile.py')
-rwxr-xr-xtest/test_multifile.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_multifile.py b/test/test_multifile.py
new file mode 100755
index 00000000..e8fa0775
--- /dev/null
+++ b/test/test_multifile.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+# Copyright 2019-2023 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
+"""Test reading from several input files."""
+
+# pylint: disable=duplicate-code
+
+import os
+import shlex
+import subprocess
+import tempfile
+
+import serd_test_util as util
+
+args = util.wrapper_args(__doc__, True)
+testdir = args.input
+in1_path = os.path.join(testdir, "input1.ttl")
+in2_path = os.path.join(testdir, "input2.trig")
+check_path = os.path.join(testdir, "output.nq")
+command = shlex.split(args.wrapper) + [args.tool, in1_path, in2_path]
+
+
+with tempfile.TemporaryFile(mode="w+", encoding="utf-8") as out:
+ proc = subprocess.run(command, check=False, stdout=out)
+
+ assert proc.returncode == 0
+
+ out.seek(0)
+ with open(check_path, "r", encoding="utf-8") as check:
+ assert util.lines_equal(list(check), list(out), check_path, "output")