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
 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
 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")
 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")