Ejemplo n.º 1
0
 def test_get_hash_fail(self, m_get, m_get_gitbuilder_url):
     m_get_gitbuilder_url.return_value = "http://baseurl.com"
     mock_resp = Mock()
     mock_resp.ok = False
     m_get.return_value = mock_resp
     result = suite.get_hash()
     assert result is None
Ejemplo n.º 2
0
 def test_get_hash_fail(self, m_get, m_get_gitbuilder_url):
     m_get_gitbuilder_url.return_value = "http://baseurl.com"
     mock_resp = Mock()
     mock_resp.ok = False
     m_get.return_value = mock_resp
     result = suite.get_hash()
     assert result is None
Ejemplo n.º 3
0
 def test_get_hash_success(self, m_get, m_get_gitbuilder_url):
     m_get_gitbuilder_url.return_value = "http://baseurl.com"
     mock_resp = Mock()
     mock_resp.ok = True
     mock_resp.text = "the_hash"
     m_get.return_value = mock_resp
     result = suite.get_hash()
     m_get.assert_called_with("http://baseurl.com/ref/master/sha1")
     assert result == "the_hash"
Ejemplo n.º 4
0
 def test_get_hash_success(self, m_get, m_get_gitbuilder_url):
     m_get_gitbuilder_url.return_value = "http://baseurl.com"
     mock_resp = Mock()
     mock_resp.ok = True
     mock_resp.text = "the_hash"
     m_get.return_value = mock_resp
     result = suite.get_hash()
     m_get.assert_called_with("http://baseurl.com/ref/master/sha1")
     assert result == "the_hash"
Ejemplo n.º 5
0
 def test_ceph_hash(self):
     resp = requests.get(
         'https://api.github.com/repos/ceph/ceph/git/refs/heads/master')
     ref_hash = resp.json()['object']['sha']
     assert suite.get_hash('ceph') == ref_hash
Ejemplo n.º 6
0
 def test_kernel_hash_saya(self):
     # We don't currently have these packages.
     assert suite.get_hash('kernel', 'master', 'basic', 'saya') is None
Ejemplo n.º 7
0
 def test_kernel_hash_saya(self):
     # We don't currently have these packages.
     assert suite.get_hash('kernel', 'master', 'default', 'saya') is None
Ejemplo n.º 8
0
 def test_ceph_hash_simple(self):
     resp = requests.get(
         'https://api.github.com/repos/ceph/ceph/git/refs/heads/master')
     ref_hash = resp.json()['object']['sha']
     assert suite.get_hash('ceph') == ref_hash