Use a real module dist_tag here instead of module_x (for believability!)

This commit is contained in:
Ralph Bean
2017-07-13 14:01:52 -04:00
parent ed0db4ddea
commit 4c60030d31

View File

@@ -102,23 +102,23 @@ class TestKojiBuilder(unittest.TestCase):
builder.module_build_tag = {"name": "module-foo-build", "id": 2}
# Set listTagged to return test data
tagged = [{"nvr": "foo-1.0-1.module_x"},
{"nvr": "bar-1.0-1.module_x"}]
tagged = [{"nvr": "foo-1.0-1.module_e0095747"},
{"nvr": "bar-1.0-1.module_e0095747"}]
builder.koji_session.listTagged.return_value = tagged
# Try to tag one artifact which is already tagged and one new ...
to_tag = ["foo-1.0-1.module_x", "new-1.0-1.module_x"]
to_tag = ["foo-1.0-1.module_e0095747", "new-1.0-1.module_e0095747"]
builder.buildroot_add_artifacts(to_tag)
# ... only new one should be added.
builder.koji_session.tagBuild.assert_called_once_with(
builder.module_build_tag["id"], "new-1.0-1.module_x")
builder.module_build_tag["id"], "new-1.0-1.module_e0095747")
# Try the same for tag_artifacts(...).
builder.koji_session.tagBuild.reset_mock()
builder.tag_artifacts(to_tag)
builder.koji_session.tagBuild.assert_called_once_with(
builder.module_tag["id"], "new-1.0-1.module_x")
builder.module_tag["id"], "new-1.0-1.module_e0095747")
class TestGetKojiClientSession(unittest.TestCase):