Skip to content

Commit

Permalink
closes #404
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfalcao committed May 13, 2021
1 parent edfb125 commit 6c37ff9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
18 changes: 9 additions & 9 deletions tests/functional/test_httplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import re
import httplib2
from freezegun import freeze_time
from sure import expect, within, microseconds
from sure import expect, within, miliseconds
from httpretty import HTTPretty, httprettified
from httpretty.core import decode_utf8


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_mock_a_simple_get_with_httplib2_read(now):
"HTTPretty should mock a simple GET with httplib2.context.http"

Expand All @@ -50,7 +50,7 @@ def test_httpretty_should_mock_a_simple_get_with_httplib2_read(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_provides_easy_access_to_querystrings(now):
"HTTPretty should provide an easy access to the querystring"

Expand Down Expand Up @@ -112,7 +112,7 @@ def test_httpretty_should_allow_adding_and_overwritting_httplib2():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_allow_forcing_headers_httplib2(now):
"HTTPretty should allow forcing headers with httplib2"

Expand Down Expand Up @@ -165,7 +165,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_rotating_responses_with_httplib2(now):
"HTTPretty should support rotating responses with httplib2"

Expand Down Expand Up @@ -196,7 +196,7 @@ def test_rotating_responses_with_httplib2(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request(now):
"HTTPretty.last_request is a mimetools.Message request from last match"

Expand All @@ -222,7 +222,7 @@ def test_can_inspect_last_request(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request_with_ssl(now):
"HTTPretty.last_request is recorded even when mocking 'https' (SSL)"

Expand All @@ -248,7 +248,7 @@ def test_can_inspect_last_request_with_ssl(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_ignores_querystrings_from_registered_uri(now):
"Registering URIs with query string cause them to be ignored"

Expand All @@ -263,7 +263,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_response(now):
("HTTPretty should call a callback function to be set as the body with"
" httplib2")
Expand Down
28 changes: 14 additions & 14 deletions tests/functional/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from freezegun import freeze_time
from contextlib import contextmanager
from sure import within, microseconds, expect
from sure import within, miliseconds, expect
from tornado import version as tornado_version
from httpretty import HTTPretty, httprettified
from httpretty.core import decode_utf8
Expand All @@ -54,7 +54,7 @@ def advance_iterator(it):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_mock_a_simple_get_with_requests_read(now):
"HTTPretty should mock a simple GET with requests.get"

Expand All @@ -68,7 +68,7 @@ def test_httpretty_should_mock_a_simple_get_with_requests_read(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_hostname_case_insensitive(now):
"HTTPretty should match the hostname case insensitive"

Expand All @@ -82,7 +82,7 @@ def test_hostname_case_insensitive(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_provides_easy_access_to_querystrings(now):
"HTTPretty should provide an easy access to the querystring"

Expand Down Expand Up @@ -144,7 +144,7 @@ def test_httpretty_should_allow_adding_and_overwritting_requests():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_allow_forcing_headers_requests(now):
"HTTPretty should allow forcing headers with requests"

Expand Down Expand Up @@ -188,7 +188,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_rotating_responses_with_requests(now):
"HTTPretty should support rotating responses with requests"

Expand Down Expand Up @@ -219,7 +219,7 @@ def test_rotating_responses_with_requests(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request(now):
"HTTPretty.last_request is a mimetools.Message request from last match"

Expand All @@ -245,7 +245,7 @@ def test_can_inspect_last_request(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request_with_ssl(now):
"HTTPretty.last_request is recorded even when mocking 'https' (SSL)"

Expand All @@ -271,7 +271,7 @@ def test_can_inspect_last_request_with_ssl(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_ignores_querystrings_from_registered_uri(now):
"HTTPretty should ignore querystrings from the registered uri (requests library)"

Expand All @@ -285,7 +285,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri(now):


@httprettified
@within(five=microseconds)
@within(five=miliseconds)
def test_streaming_responses(now):
"""
Mock a streaming HTTP response, like those returned by the Twitter streaming
Expand Down Expand Up @@ -456,7 +456,7 @@ def test_multipart():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_response(now):
("HTTPretty should call a callback function and set its return value as the body of the response"
" requests")
Expand Down Expand Up @@ -485,7 +485,7 @@ def request_callback(request, uri, headers):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_body_remains_callable_for_any_subsequent_requests(now):
("HTTPretty should call a callback function more than one"
" requests")
Expand All @@ -505,7 +505,7 @@ def request_callback(request, uri, headers):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_setting_headers_and_status_response(now):
("HTTPretty should call a callback function and uses it retur tuple as status code, headers and body"
" requests")
Expand Down Expand Up @@ -556,7 +556,7 @@ def test_httpretty_should_respect_matcher_priority():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_setting_content_length_on_head(now):
("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")
Expand Down
18 changes: 9 additions & 9 deletions tests/functional/test_urllib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
urlopen = urllib2.urlopen

from freezegun import freeze_time
from sure import within, microseconds
from sure import within, miliseconds
from httpretty import HTTPretty, httprettified
from httpretty.core import decode_utf8


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_mock_a_simple_get_with_urllib2_read():
"HTTPretty should mock a simple GET with urllib2.read()"

Expand All @@ -56,7 +56,7 @@ def test_httpretty_should_mock_a_simple_get_with_urllib2_read():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_provides_easy_access_to_querystrings(now):
"HTTPretty should provide an easy access to the querystring"

Expand Down Expand Up @@ -127,7 +127,7 @@ def test_httpretty_should_allow_adding_and_overwritting_urllib2():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_allow_forcing_headers_urllib2():
"HTTPretty should allow forcing headers with urllib2"

Expand Down Expand Up @@ -177,7 +177,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_should_support_a_list_of_successive_responses_urllib2(now):
("HTTPretty should support adding a list of successive "
"responses with urllib2")
Expand Down Expand Up @@ -210,7 +210,7 @@ def test_httpretty_should_support_a_list_of_successive_responses_urllib2(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request(now):
"HTTPretty.last_request is a mimetools.Message request from last match"

Expand Down Expand Up @@ -239,7 +239,7 @@ def test_can_inspect_last_request(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_can_inspect_last_request_with_ssl(now):
"HTTPretty.last_request is recorded even when mocking 'https' (SSL)"

Expand Down Expand Up @@ -268,7 +268,7 @@ def test_can_inspect_last_request_with_ssl(now):


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_httpretty_ignores_querystrings_from_registered_uri():
"HTTPretty should mock a simple GET with urllib2.read()"

Expand All @@ -285,7 +285,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri():


@httprettified
@within(two=microseconds)
@within(two=miliseconds)
def test_callback_response(now):
("HTTPretty should call a callback function to be set as the body with"
" urllib2")
Expand Down

0 comments on commit 6c37ff9

Please sign in to comment.