test/builder: check --cert command line option

Check that passing `--cert` as a command line option works, for
this we use real working certificates because this will actually
be parsed by requests.
This commit is contained in:
Christian Kellner 2020-09-16 18:21:18 +02:00
parent 15f645e6fa
commit 955c531000
4 changed files with 71 additions and 1 deletions

View file

@ -364,6 +364,11 @@ class TestBuilderPlugin(PluginTest):
composer = MockComposer(url, architectures=["x86_64"])
composer.httpretty_regsiter()
certs = [
"test/data/example-crt.pem",
"test/data/example-key.pem"
]
args = [
"plugins/builder/osbuild.py",
"compose",
@ -372,7 +377,9 @@ class TestBuilderPlugin(PluginTest):
"20201015.0",
"fedora-32",
"http://download.localhost/pub/linux/$arch",
"x86_64"
"x86_64",
"--cert", ", ".join(certs),
"--ca", "test/data/example-ca.pem"
]
with unittest.mock.patch.object(sys, 'argv', args):