#1 When allow_net_connect = False, a request that otherwise ... WARNING:tornado.access:404 GET / (::1) 1.98ms real call to socket.connect() for ('localhost', 39663) passed #2 When allow_net_connect = False, a request that would have ... httpretty.core.socket("example.com:80").real_sendall(123 bytes) to http://example.com/nonsense via GET at 1638491682.3868065 passed #3 When allow_net_connect = False, mocked requests still work correctly. ... passed #4 httpretty should bypass a unregistered request by disabling it ... WARNING:tornado.access:404 GET / (::1) 2.38ms httpretty.core.socket("localhost:49327").real_sendall(130 bytes) to http://localhost:49327/come-again/ via GET at 1638491683.5209346 real call to socket.connect() for passed #5 httpretty should bypass all requests by disabling it ... WARNING:tornado.access:404 GET / (::1) 1.37ms passed #6 httpretty should work even when testing code that also use other TCP-based protocols ... passed #7 HTTPretty should forward_and_trace socket.recv_into ... skipped #8 HTTPretty should forward_and_trace socket.recvfrom ... skipped #9 HTTPretty should forward_and_trace socket.recvfrom_into ... skipped #10 HTTPretty should forward_and_trace socket.send ... skipped #11 HTTPretty should forward_and_trace socket.sendto ... skipped #12 test_decorated (tests.functional.test_decorator.ClassDecorator) ... passed #13 test_decorated2 (tests.functional.test_decorator.ClassDecorator) ... passed #14 test_decorated (tests.functional.test_decorator.ClassDecoratorWithSetUp) ... passed #15 test_decorated2 (tests.functional.test_decorator.ClassDecoratorWithSetUp) ... passed #16 test_decorated (tests.functional.test_decorator.NonUnitTestTest) ... passed #17 tests.functional.test_decorator.test_decor ... passed #18 HTTPretty should call a callback function to be set as the body with httplib2 ... passed #19 HTTPretty.last_request is a mimetools.Message request from last match ... passed #20 HTTPretty.last_request is recorded even when mocking 'https' (SSL) ... passed #21 Registering URIs with query string cause them to be ignored ... passed #22 HTTPretty should provide an easy access to the querystring ... passed #23 HTTPretty should allow adding and overwritting headers by keyword args with httplib2 ... passed #24 HTTPretty should allow adding and overwritting headers with httplib2 ... passed #25 HTTPretty should allow forcing headers with httplib2 ... passed #26 HTTPretty should allow registering regexes with httplib2 ... passed #27 HTTPretty should mock a simple GET with httplib2.context.http ... passed #28 HTTPretty should mock basic headers with httplib2 ... passed #29 HTTPretty should support rotating responses with httplib2 ... passed #30 tests.functional.test_passthrough.test_http_passthrough ... passed #31 tests.functional.test_passthrough.test_https_passthrough ... passed #32 HTTPretty should be able to record calls ... passed #33 HTTPretty should call a callback function more than one requests ... passed #34 HTTPretty should call a callback function and set its return value as the body of the response requests ... passed #35 HTTPretty should call a callback function, use it's return tuple as status code, headers and body requests and respect the content-length header when responding to HEAD ... passed #36 HTTPretty should call a callback function and uses it retur tuple as status code, headers and body requests ... passed #37 HTTPretty.last_request is a mimetools.Message request from last match ... passed #38 HTTPretty.last_request is recorded even when mocking 'https' (SSL) ... passed #39 HTTPretty should match the hostname case insensitive ... passed #40 HTTPretty should provide a way to not match regexes that have a different querystring ... passed #41 HTTPretty should ignore querystrings from the registered uri (requests library) ... passed #42 HTTPretty should provide an easy access to the querystring ... passed #43 HTTPretty should match regexes even if they have a different querystring ... passed #44 HTTPretty should reset protocol/port associations ... passed #45 HTTPretty should allow adding and overwritting headers by keyword args with requests ... passed #46 HTTPretty should allow adding and overwritting headers with requests ... passed #47 HTTPretty should allow forcing headers with requests ... passed #48 HTTPretty should allow registering multiple methods for the same uri ... passed #49 HTTPretty should allow multiple responses when binding multiple methods to the same uri ... passed #50 HTTPretty should allow registering regexes with requests ... passed #51 HTTPretty should allow registering regexes with requests and giva a proper match to the callback ... passed #52 HTTPretty should allow registering regexes with requests and giva a proper match to the callback ... passed #53 HTTPretty should allow registering regexes with streaming responses ... passed #54 HTTPretty should handle URLs with paths starting with // ... passed #55 HTTPretty should mock a simple GET with requests.get ... passed #56 HTTPretty should mock basic headers with requests ... passed #57 HTTPretty should normalize all url patching ... passed #58 tests.functional.test_requests.test_httpretty_should_respect_matcher_priority ... passed #59 HTTPretty should work with a non-standard port number ... passed #60 HTTPretty should automatically append a slash to given urls ... passed #61 tests.functional.test_requests.test_multiline ... passed #62 tests.functional.test_requests.test_multipart ... passed #63 tests.functional.test_requests.test_octet_stream ... passed #64 HTTPretty should call a callback function *once* and set its return value as the body of the response requests ... passed #65 HTTPretty should support rotating responses with requests ... passed #66 Mock a streaming HTTP response, like those returned by the Twitter streaming ... passed #67 Querystrings should accept unicode characters ... passed #68 HTTPretty should call a callback function to be set as the body with urllib2 ... passed #69 HTTPretty.last_request is a mimetools.Message request from last match ... passed #70 HTTPretty.last_request is recorded even when mocking 'https' (SSL) ... passed #71 HTTPretty should mock a simple GET with urllib2.read() ... passed #72 HTTPretty should provide an easy access to the querystring ... passed #73 HTTPretty should allow adding and overwritting headers by keyword args with urllib2 ... passed #74 HTTPretty should allow adding and overwritting headers with urllib2 ... passed #75 HTTPretty should allow forcing headers with urllib2 ... passed #76 HTTPretty should allow registering regexes with urllib2 ... passed #77 HTTPretty should mock a simple GET with urllib2.read() ... passed #78 HTTPretty should mock basic headers with urllib2 ... passed #79 HTTPretty should support adding a list of successive responses with urllib2 ... passed #80 HTTPretty should remove PyOpenSSLs urllib3 mock if it is installed ... passed #81 HTTPrettyRequest is a BaseHTTPRequestHandler that replaces real socket file descriptors with in-memory ones ... passed #82 HTTPrettyRequest#parse_querystring should parse unicode data ... passed #83 HTTPrettyRequest#parse_request_body recognizes the content-type `application/json` and parses it ... passed #84 HTTPrettyRequest#parse_request_body recognizes the content-type `text/json` and parses it ... passed #85 HTTPrettyRequest#parse_request_body recognizes the content-type `application/x-www-form-urlencoded` and parses it ... passed #86 HTTPrettyRequest#parse_request_body returns the value as is if the Content-Type is not recognized ... passed #87 HTTPrettyRequest should have a forward_and_trace-friendly string representation ... passed #88 FakeSSLSocket is a simpel wrapper around its own socket, which was designed to be a HTTPretty fake socket ... passed #89 fakesock.socket#ssl should take a socket instance and return itself ... passed #90 fakesock.socket#sendall handles paths starting with // well ... passed #91 URIMatcher response querystring ... passed #92 URIMatcher equality check should check querystring ... passed #93 fakesock.socket#getpeercert should return a hardcoded fake certificate ... passed #94 fakesock.socket#close should close the actual socket in case it's not http and __truesock_is_connected__ is True ... passed #95 fakesock.socket#connect should open a real connection if the given port is not a potential http port ... WARNING:httpretty.core:real call to socket.connect() for ('somewhere.com', 42) passed #96 fakesock.socket#makefile should set the mode, bufsize and return its mocked file descriptor ... passed #97 fakesock.socket#real_sendall calls truesock#connect and bails out when not http ... passed #98 fakesock.socket#real_sendall should continue if the socket error was EAGAIN ... WARNING:httpretty.core:real call to socket.connect() for ('1.2.3.4', 42) passed #99 fakesock.socket#real_sendall should continue if the socket error was EAGAIN ... WARNING:httpretty.core:real call to socket.connect() for ('1.2.3.4', 42) passed #100 fakesock.socket#real_sendall sends data and buffers the response in the file descriptor ... WARNING:httpretty.core:real call to socket.connect() for ('1.2.3.4', 42) passed #101 fakesock.socket#real_sendall should connect before sending data ... WARNING:httpretty.core:real call to socket.connect() for ('foobar.com', 4000) passed #102 fakesock.socket#sendall should call real_sendall when not parsing headers and there is no entry ... WARNING:httpretty.core:real call to socket.connect() for ('foo.com', 80) passed #103 fakesock.socket#sendall should call real_sendall when not ... WARNING:httpretty.core:real call to socket.connect() for ('foo.com', 80) passed #104 fakesock.socket#sendall should call real_sendall when there is no entry ... WARNING:httpretty.core:real call to socket.connect() for ('foo.com', 80) passed #105 fakesock.socket#sendall should create an entry if it's given a valid request line ... WARNING:httpretty.core:real call to socket.connect() for ('foo.com', 80) passed #106 fakesock.socket#sendall should create an entry if it's given a valid request line ... WARNING:httpretty.core:real call to socket.connect() for ('foo.com', 80) passed #107 parse_requestline should parse the CONNECT method appropriately ... passed #108 HTTPretty should raise proper exception on inconsistent Content-Length / registered response body ... passed #109 HTTPretty.last_request is a dummy object by default ... passed #110 HTTPretty supports N status codes ... passed #111 tests.unit.test_httpretty.test_uri_info_full_url ... passed #112 Test that URIInfo.__eq__ method ignores case for ... passed #113 tests.unit.test_httpretty.test_global_boolean_enabled ... passed #114 tests.unit.test_httpretty.test_py3kobject_implements_valid__repr__based_on__str__ ... passed #115 tests.unit.test_httpretty.test_Entry_class_normalizes_headers ... passed #116 tests.unit.test_httpretty.test_Entry_class_counts_multibyte_characters_in_bytes ... passed #117 tests.unit.test_httpretty.test_Entry_class_counts_dynamic ... passed #118 tests.unit.test_httpretty.test_fake_socket_passes_through_setblocking ... passed #119 tests.unit.test_httpretty.test_fake_socket_passes_through_fileno ... passed #120 tests.unit.test_httpretty.test_fake_socket_passes_through_getsockopt ... passed #121 tests.unit.test_httpretty.test_fake_socket_passes_through_bind ... passed #122 tests.unit.test_httpretty.test_fake_socket_passes_through_connect_ex ... passed #123 tests.unit.test_httpretty.test_fake_socket_passes_through_listen ... passed #124 tests.unit.test_httpretty.test_fake_socket_passes_through_getpeername ... passed #125 tests.unit.test_httpretty.test_fake_socket_passes_through_getsockname ... passed #126 tests.unit.test_httpretty.test_fake_socket_passes_through_gettimeout ... passed #127 tests.unit.test_httpretty.test_fake_socket_passes_through_shutdown ... passed #128 tests.unit.test_httpretty.test_unix_socket ... WARNING:httpretty.core:real call to socket.connect() for ./not-exist-socket passed #129 A content-type of application/json should parse a valid json body ... passed #130 A content-type of application/json with an invalid json body should return the content unaltered ... passed #131 A content-type of x-www-form-urlencoded with a valid queryparam body should return parsed content ... passed #132 A non-handled content type request's post body should return the content unaltered ... passed #133 Some versions of python accidentally internally shadowed the SockType ... passed #134 tests.unit.test_httpretty.test_socktype_good_python_version ... passed #135 HTTPretty should allow registering regexes with requests ... passed #136 HTTPretty should allow registering regexes with requests (ssl version) ... passed #137 httpretty.has_request() correctly detects whether or not a request has been made ... passed #138 httpretty.last_request() should return httpretty.core.last_request ... passed #139 httpretty.latest_requests() should return httpretty.core.latest_requests ... passed ====================================================================== 7) SKIP: HTTPretty should forward_and_trace socket.recv_into ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 8) SKIP: HTTPretty should forward_and_trace socket.recvfrom ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 9) SKIP: HTTPretty should forward_and_trace socket.recvfrom_into ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 10) SKIP: HTTPretty should forward_and_trace socket.send ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported ====================================================================== 11) SKIP: HTTPretty should forward_and_trace socket.sendto ---------------------------------------------------------------------- No Traceback SkipTest: not currently supported Name Stmts Miss Branch BrPart Cover --------------------------------------------------------- httpretty/__init__.py 45 0 0 0 100% httpretty/compat.py 17 0 0 0 100% httpretty/core.py 1007 109 310 43 87% httpretty/errors.py 16 0 6 0 100% httpretty/http.py 28 0 4 1 97% httpretty/utils.py 8 0 4 0 100% httpretty/version.py 1 0 0 0 100% --------------------------------------------------------- TOTAL 1122 109 324 44 88% ----------------------------------------------------------------------------- 139 tests run in 13.079 seconds. 5 skipped (134 tests passed) 212.04 2000 29.77 2000 116.24 2000 24.02 2000 19.2 2000 17.55 2000 18.92 2000 268.96 2000 110.14 2000 106.7 2000 52.11 2000 112.87 2000 52.46 2000 61.65 2000 44.5 2000 66.67 2000 56.42 2000 44.16 2000 48.95 2000 144.29 2000 297.93 5000 192.36 2000 38.37 2000 100.14 2000 23.82 2000 19.33 2000 17.01 2000 20.55 2000 266.62 2000