]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
GitbuilderProject test: respect branch in config
authorZack Cerza <zack@redhat.com>
Wed, 29 Jun 2016 22:55:22 +0000 (16:55 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 29 Jun 2016 22:55:22 +0000 (16:55 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_packaging.py

index 365edd1d6d2784dfc99110579cf66edc8cec98fa..46aea554c05e87d8e135c2e2f626a863c44dadde 100644 (file)
@@ -356,6 +356,21 @@ class TestGitbuilderProject(object):
         expected = "http://gitbuilder.ceph.com/ceph-deb-trusty-x86_64-basic/sha1/sha1"
         assert result == expected
 
+    @patch("teuthology.packaging.config")
+    def test_init_from_config_branch_ref(self, m_config):
+        m_config.baseurl_template = \
+            'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'
+        m_config.gitbuilder_host = "gitbuilder.ceph.com"
+        config = dict(
+            os_type="ubuntu",
+            os_version="14.04",
+            branch='jewel',
+        )
+        gp = packaging.GitbuilderProject("ceph", config)
+        result = gp.uri_reference
+        expected = 'ref/jewel'
+        assert result == expected
+
     @patch("teuthology.packaging.config")
     @patch("teuthology.packaging._get_config_value_for_remote")
     @patch("teuthology.packaging._get_response")