test/noop: add format version 2 noop test
Add a simple noop pipeline, with a noop stage and a noop input, which all in all does nothing much; but it will validate, load exectue the pipeline, stage and inputs. So maybe not really "nothing" in the strictest sense.
This commit is contained in:
parent
5cd139d53a
commit
5b2783be53
1 changed files with 32 additions and 0 deletions
|
|
@ -2,11 +2,37 @@
|
|||
# Runtime Tests for No-op Pipelines
|
||||
#
|
||||
|
||||
import json
|
||||
import unittest
|
||||
import tempfile
|
||||
|
||||
from .. import test
|
||||
|
||||
|
||||
NOOP_V2 = {
|
||||
"version": "2",
|
||||
"pipelines": [
|
||||
{
|
||||
"name": "noop",
|
||||
"stages": [
|
||||
{
|
||||
"type": "org.osbuild.noop",
|
||||
"options": {"zero": 0},
|
||||
"inputs": {
|
||||
"tree": {
|
||||
"type": "org.osbuild.noop",
|
||||
"origin": "org.osbuild.pipeline",
|
||||
"references": {
|
||||
"foo": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
class TestNoop(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.osbuild = test.OSBuild(self)
|
||||
|
|
@ -28,3 +54,9 @@ class TestNoop(unittest.TestCase):
|
|||
with self.osbuild as osb:
|
||||
osb.compile("{}")
|
||||
osb.compile("{}")
|
||||
|
||||
|
||||
def test_noop_v2(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
with self.osbuild as osb:
|
||||
osb.compile(json.dumps(NOOP_V2), output_dir=tmp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue