From 6c3450055b0b445b8b03d20eafdfc8e601d4e940 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 16 Dec 2016 15:11:40 -0700 Subject: [PATCH] Add tests for suite.expand_short_repo_name() Signed-off-by: Zack Cerza --- teuthology/suite/test/test_init.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/teuthology/suite/test/test_init.py b/teuthology/suite/test/test_init.py index 78a6f21300..c347141e14 100644 --- a/teuthology/suite/test/test_init.py +++ b/teuthology/suite/test/test_init.py @@ -103,6 +103,31 @@ def test_wait_fails(m_get_jobs): suite.wait('name', 1, None) +REPO_SHORTHAND = [ + ['https://github.com/dude/foo', 'bar', + 'https://github.com/dude/bar'], + ['https://github.com/dude/foo/', 'bar', + 'https://github.com/dude/bar/'], + ['https://github.com/ceph/ceph', 'ceph', + 'https://github.com/ceph/ceph'], + ['https://github.com/ceph/ceph', 'ceph-ci', + 'https://github.com/ceph/ceph-ci'], + ['https://github.com/ceph/ceph-ci', 'ceph', + 'https://github.com/ceph/ceph'], + ['git://git.ceph.com/ceph.git', 'ceph', + 'git://git.ceph.com/ceph.git'], + ['git://git.ceph.com/ceph.git', 'ceph-ci', + 'git://git.ceph.com/ceph-ci.git'], + ['git://git.ceph.com/ceph-ci.git', 'ceph', + 'git://git.ceph.com/ceph.git'], +] + + +@pytest.mark.parametrize(['orig', 'shorthand', 'result'], REPO_SHORTHAND) +def test_expand_short_repo_name(orig, shorthand, result): + assert suite.expand_short_repo_name(shorthand, orig) == result + + class TestSuiteMain(object): def test_main(self): suite_name = 'SUITE' -- 2.39.5