From f81ae9c4c3875d3487263a1bb6d0133c8a331503 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sat, 25 Apr 2020 11:10:04 +0200 Subject: [PATCH] test/assemblers: omit None compression option In the "test_tar" test the compression can be None, which in turn will be serialized as "compression: null" in the options dict. However, this is not a valid option according to the schema. The schema could be adapted to allow for this but it is probably better to just omit empty or null values. --- test/test_assemblers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/test_assemblers.py b/test/test_assemblers.py index 9e8bc45e..3f6c75d9 100644 --- a/test/test_assemblers.py +++ b/test/test_assemblers.py @@ -107,10 +107,9 @@ class TestAssemblers(osbuildtest.TestCase): ("tree.tar.gz", "gzip", ["application/x-gzip", "application/gzip"]) ] for filename, compression, expected_mimetypes in cases: - options = { - "filename": filename, - "compression": compression - } + options = {"filename": filename} + if compression: + options["compression"] = compression _, output_id = self.run_assembler("org.osbuild.tar", options) image = f"{self.store}/refs/{output_id}/{filename}" output = subprocess.check_output(["file", "--mime-type", image], encoding="utf-8")