Ejemplo n.º 1
0
 def test_get_missing_build_config(self, openshift):  # noqa
     build_config_name = 'some-build-config-name'
     expected_url = openshift._build_url("buildconfigs/%s/" %
                                         build_config_name)
     (flexmock(openshift).should_receive("_get").with_args(
         expected_url).once().and_return(HttpResponse(404, {}, b'')))
     with pytest.raises(OsbsResponseException):
         openshift.get_build_config(build_config_name)
Ejemplo n.º 2
0
 def test_get_missing_build_config(self, openshift):
     build_config_name = 'some-build-config-name'
     expected_url = openshift._build_url("buildconfigs/%s/" % build_config_name)
     (flexmock(openshift)
         .should_receive("_get")
         .with_args(expected_url)
         .once()
         .and_return(HttpResponse(404, {}, '')))
     with pytest.raises(OsbsResponseException):
         openshift.get_build_config(build_config_name)
Ejemplo n.º 3
0
 def test_get_build_config(self, openshift):  # noqa
     mock_response = {"spam": "maps"}
     build_config_name = 'some-build-config-name'
     expected_url = openshift._build_url("buildconfigs/%s/" %
                                         build_config_name)
     (flexmock(openshift).should_receive("_get").with_args(
         expected_url).once().and_return(make_json_response(mock_response)))
     response = openshift.get_build_config(build_config_name)
     assert response['spam'] == 'maps'
Ejemplo n.º 4
0
 def test_get_build_config(self, openshift):
     mock_response = {"spam": "maps"}
     build_config_name = 'some-build-config-name'
     expected_url = openshift._build_url("buildconfigs/%s/" % build_config_name)
     (flexmock(openshift)
         .should_receive("_get")
         .with_args(expected_url)
         .once()
         .and_return(HttpResponse(200, {}, json.dumps(mock_response))))
     response = openshift.get_build_config(build_config_name)
     assert response['spam'] == 'maps'