Example #1
0
    def test_http_get_handler_on_200(self):
        responses.add(responses.GET, Configs.stratos_api_url,
                      body='{"keyOne": "valueOne"}', status=200,
                      content_type='application/json')

        r = Stratos.get("")

        assert r == {"keyOne": "valueOne"}
Example #2
0
    def test_http_get_handler_on_500(self):
        responses.add(responses.GET, Configs.stratos_api_url,
                      body='', status=500,
                      content_type='application/json')

        self.assertRaises(BadResponseError, Stratos.get(""))