예제 #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
예제 #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
예제 #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"
예제 #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"
예제 #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
예제 #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
예제 #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
예제 #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