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

        r = Stratos.post("")

        assert r is True
예제 #2
0
    def test_http_post_handler_on_500(self):
        responses.add(responses.POST, Configs.stratos_api_url,
                      body='', status=500,
                      content_type='application/json')

        self.assertRaises(BadResponseError, Stratos.post(""))
예제 #3
0
    def test_http_get_handler_on_404(self):
        responses.add(responses.GET, Configs.stratos_api_url,
                      body='', status=404,
                      content_type='application/json')

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