コード例 #1
0
 def _mock_content_type(self, m, content_type):
     """Convenience method for mocking a content type."""
     m.register_uri("GET",
                    "http://test.com",
                    text="Ok",
                    headers={"Content-Type": content_type})
     return client.request("GET", "http://test.com")
コード例 #2
0
ファイル: test_http_checks.py プロジェクト: knangia/syntribos
 def _mock_content_type(self, m, content_type):
     """Convenience method for mocking a content type."""
     m.register_uri("GET", "http://test.com", text="Ok",
                    headers={"Content-Type": content_type})
     return client.request("GET", "http://test.com")
コード例 #3
0
ファイル: test_http_checks.py プロジェクト: knangia/syntribos
 def _mock_status_code(self, m, code):
     """Convenience method for mocking a status code."""
     m.register_uri("GET", "http://test.com", text="Ok", status_code=code)
     return client.request("GET", "http://test.com")
コード例 #4
0
 def _mock_status_code(self, m, code):
     """Convenience method for mocking a status code."""
     m.register_uri("GET", "http://test.com", text="Ok", status_code=code)
     return client.request("GET", "http://test.com")