From 4e1850852a74fe6904beabf793ea8d9915cab246 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 29 Mar 2023 23:34:40 -0400 Subject: Add support for reading multiple files at once --- test/test_multifile.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 test/test_multifile.py (limited to 'test/test_multifile.py') 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 +# 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") -- cgit v1.2.1