fix tests

This commit is contained in:
Tomas Kopecek 2021-04-12 15:10:22 +02:00
parent ef3e2cd04b
commit c732f49ac8
4 changed files with 21 additions and 6 deletions

View file

@ -26,7 +26,8 @@ class TestBuildinfo(utils.CliTestCase):
time.tzset()
self.taskinfo = {'arch': 'noarch',
'id': 8,
'method': 'build'}
'method': 'build',
'request': ['src', 'target', 'opts']}
self.buildinfo = {'build_id': 1,
'id': 1,
'name': 'test-build',
@ -60,7 +61,7 @@ class TestBuildinfo(utils.CliTestCase):
State: COMPLETE
Built by: kojiadmin
Volume: DEFAULT
Task: 8 build (noarch)
Task: 8 build (target, src)
Finished: Thu, 04 Mar 2021 14:45:40 UTC
Tags:
"""

View file

@ -190,7 +190,8 @@ class TestCliListTasks(utils.CliTestCase):
'method': 'createrepo',
'parent': 3,
'priority': 14,
'arch': 'noarch'
'arch': 'noarch',
'request': ['tag'],
},
{
'children':
@ -203,7 +204,8 @@ class TestCliListTasks(utils.CliTestCase):
'method': 'createrepo',
'parent': 3,
'priority': 14,
'arch': 'noarch'
'arch': 'noarch',
'request': ['repo_id', 'noarch', 'oldrepo'],
},
],
'id': 3,
@ -212,13 +214,14 @@ class TestCliListTasks(utils.CliTestCase):
'method': 'newRepo',
'priority': 15,
'arch': 'noarch',
'request': ['tag'],
}
]
header = \
"ID Pri Owner State Arch Name\n"
task_output = \
"3 15 kojiadmin FREE noarch newRepo (noarch)\n" + \
"3 15 kojiadmin FREE noarch newRepo (tag)\n" + \
"5 14 kojiadmin FREE noarch +createrepo (noarch)\n"
expected = self.format_error_message(

View file

@ -121,7 +121,7 @@ class TestParseTaskParams(utils.CliTestCase):
'id': 1,
'method': 'wrapperRPM',
'arch': 'x86_64',
'request': [1, {'name': target}, self.build_templ]
'request': [1, {'name': target}, self.build_templ, 'task', 'opts']
},
{'wrapRPM-test': True}]
expect = ["Spec File URL: %s" % params[0]]

View file

@ -149,6 +149,17 @@ class TestTaskLabel(unittest.TestCase):
'request': [123, {'name': 'hostname'}],
}, 'restartVerify (hostname)'
],
[
{'method': 'vmExec', 'arch': 'x86_64',
'request': ['name', 'task_info', 'opts'],
}, 'vmExec (name)'
],
[
{'method': 'winbuild', 'arch': 'x86_64',
'request': ['name', 'source_url', 'target', 'opts'],
}, 'winbuild (target, :source_url)'
],
]
for input, output in test_data: