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.
This commit is contained in:
Christian Kellner 2020-04-25 11:10:04 +02:00
parent b7367c037e
commit f81ae9c4c3

View file

@ -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")