Additional tests for validate_koji_tag:

- Verify that ProgrammingError exception does what it is intended to do.
- Two (str/list) negative tests for validate_koji_tag decorator itself.
- Two (str/list) positive tests for validate_koji_tag decorator itself.
- Support validation in a test for Koji builder.
This commit is contained in:
Filip Valder
2017-02-27 15:24:44 +01:00
parent a4366d9be7
commit be3b05e673
2 changed files with 50 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ class TestKojiBuilder(unittest.TestCase):
module='nginx',
config=conf,
tag_name='module-nginx-1.2')
fake_kmb.module_target = {'build_tag': 'fake_tag'}
fake_kmb.module_target = {'build_tag': 'module-fake_tag'}
with self.assertRaises(IOError):
fake_kmb.buildroot_ready()
@@ -117,5 +117,6 @@ class FakeKojiSession(koji.ClientSession):
def _setup_connection(self):
pass
@module_build_service.utils.validate_koji_tag('tag')
def getRepo(self, tag):
return {'create_event': 'fake event'}