From: Andrew Schoen Date: Tue, 11 Aug 2015 16:20:42 +0000 (-0500) Subject: packaging.GitbuilderProject: add a test to ensure base_url is correct for wheezy X-Git-Tag: 1.1.0~848^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69bed306bac122adba64104cbf4db06eba8fe7ed;p=teuthology.git packaging.GitbuilderProject: add a test to ensure base_url is correct for wheezy remote.os.codename returns an empty string for debian which resulted in the base_url missing the 'wheezy' part of it, this fixes that. Signed-off-by: Andrew Schoen --- diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 67ba2a892..7559b817d 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -303,6 +303,20 @@ class TestGitbuilderProject(object): expected = "http://gitbuilder.ceph.com/ceph-deb-trusty-x86_64-basic/ref/master" assert result == expected + @patch("teuthology.packaging.config") + @patch("teuthology.packaging._get_config_value_for_remote") + def test_init_from_remote_base_url_debian(self, m_get_config_value, m_config): + m_config.baseurl_template = 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}' + m_config.gitbuilder_host = "gitbuilder.ceph.com" + m_get_config_value.return_value = None + # remote.os.codename returns and empty string on debian + rem = self._get_remote(distro="debian", codename='', version="7.1") + ctx = dict(foo="bar") + gp = packaging.GitbuilderProject("ceph", {}, ctx=ctx, remote=rem) + result = gp.base_url + expected = "http://gitbuilder.ceph.com/ceph-deb-wheezy-x86_64-basic/ref/master" + assert result == expected + @patch("teuthology.packaging.config") def test_init_from_config_base_url(self, m_config): m_config.baseurl_template = 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'