Added test for CG_Importer test_build

This commit is contained in:
Joel Vasallo 2016-06-03 17:54:12 -05:00 committed by Mike McLean
parent 65347a73f7
commit c012f78317
2 changed files with 14 additions and 0 deletions

View file

@ -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,

View file

@ -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)