Added test for CG_Importer test_build
This commit is contained in:
parent
65347a73f7
commit
c012f78317
2 changed files with 14 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
"version": "7.1",
|
||||
"release": "4",
|
||||
"source": "git://git.engineering.redhat.com/users/vpavlin/tdl_templates.git#a14f145244",
|
||||
"extra": {},
|
||||
"start_time": 1423148398,
|
||||
"end_time": 1423148828},
|
||||
"buildroots": [{"id": 1,
|
||||
|
|
|
|||
|
|
@ -58,3 +58,16 @@ class TestCGImporter(unittest.TestCase):
|
|||
x.assert_cg_access()
|
||||
assert x.cgs
|
||||
assert isinstance(x.cgs, set)
|
||||
|
||||
@mock.patch('kojihub.context')
|
||||
@mock.patch("koji.pathinfo.work")
|
||||
def test_prep_build(self, work, context):
|
||||
work.return_value = os.path.dirname(__file__)
|
||||
cursor = mock.MagicMock()
|
||||
context.cnx.cursor.return_value = cursor
|
||||
#cursor.fetchall.return_value = [(1, 'foo'), (2, 'bar')]
|
||||
x = kojihub.CG_Importer()
|
||||
x.get_metadata('default.json', 'cg_importer_json')
|
||||
x.prep_build()
|
||||
assert x.buildinfo
|
||||
assert isinstance(x.buildinfo, dict)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue