From 09bf03fd6e522d6e421fed85d010057f87486544 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 31 Mar 2023 14:20:03 -0400 Subject: Add empty syntax type for suppressing output --- test/test_empty.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/test_empty.py (limited to 'test/test_empty.py') diff --git a/test/test_empty.py b/test/test_empty.py new file mode 100755 index 00000000..3cd5517b --- /dev/null +++ b/test/test_empty.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +# Copyright 2022-2023 David Robillard +# SPDX-License-Identifier: ISC + +"""Test writing empty output.""" + +# pylint: disable=duplicate-code + +import shlex +import subprocess +import tempfile + +import serd_test_util as util + +args = util.wrapper_args(__doc__, True) +command = shlex.split(args.wrapper) + [args.serdi, "-o", "empty", args.input] + +with tempfile.TemporaryFile() as out: + proc = subprocess.run(command, check=False, stdout=out) + + out.seek(0, 2) # Seek to end + + assert proc.returncode == 0 + assert out.tell() == 0 -- cgit v1.2.1