test/api: check for 'get-arguments'/api.arguments
Simple check for the new server side method, `get-arguments`, and client side counterpart, `api.arguments`, that compares that using the later we get the supplied input (arguments) to API.
This commit is contained in:
parent
e273dd0084
commit
fc5e0070c5
1 changed files with 11 additions and 0 deletions
|
|
@ -68,6 +68,17 @@ class TestAPI(unittest.TestCase):
|
|||
with api:
|
||||
pass
|
||||
|
||||
def test_get_arguments(self):
|
||||
tmpdir = self.tmp.name
|
||||
path = os.path.join(tmpdir, "osbuild-api")
|
||||
args = {"options": {"answer": 42}}
|
||||
monitor = osbuild.monitor.BaseMonitor(sys.stderr.fileno())
|
||||
|
||||
with osbuild.api.API(args, monitor, socket_address=path) as _:
|
||||
data = osbuild.api.arguments(path=path)
|
||||
self.assertEqual(data, args)
|
||||
|
||||
|
||||
def test_metadata(self):
|
||||
# Check that `api.metadata` leads to `API.metadata` being
|
||||
# set correctly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue