summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Falcão <gabriel@nacaolivre.org>2021-05-14 01:32:44 +0200
committerGabriel Falcão <gabriel@nacaolivre.org>2021-05-14 01:32:44 +0200
commit6c37ff9db14caeb4099513a00f2adc5b0f2da1af (patch)
treed455c8dc8fbad668d4c8f76c2d66b7380951d915
parentedfb1256e4383ee6e7181d888f96d42f14781d5c (diff)
downloadhttpretty-6c37ff9db14caeb4099513a00f2adc5b0f2da1af.tar.gz
closes #404
-rw-r--r--tests/functional/test_httplib2.py18
-rw-r--r--tests/functional/test_requests.py28
-rw-r--r--tests/functional/test_urllib2.py18
3 files changed, 32 insertions, 32 deletions
diff --git a/tests/functional/test_httplib2.py b/tests/functional/test_httplib2.py
index 832e23c..9241f51 100644
--- a/tests/functional/test_httplib2.py
+++ b/tests/functional/test_httplib2.py
@@ -29,13 +29,13 @@ from __future__ import unicode_literals
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"
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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)"
@@ -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"
@@ -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")
diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py
index 7da9ce3..cd77255 100644
--- a/tests/functional/test_requests.py
+++ b/tests/functional/test_requests.py
@@ -31,7 +31,7 @@ import httpretty
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
@@ -54,7 +54,7 @@ server_url = lambda path, port: "http://localhost:{}/{}".format(port, path.lstri
@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"
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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)"
@@ -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)"
@@ -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
@@ -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")
@@ -485,7 +485,7 @@ def test_callback_response(now):
@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")
@@ -505,7 +505,7 @@ def test_callback_body_remains_callable_for_any_subsequent_requests(now):
@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")
@@ -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")
diff --git a/tests/functional/test_urllib2.py b/tests/functional/test_urllib2.py
index 3550dfb..fb36eb5 100644
--- a/tests/functional/test_urllib2.py
+++ b/tests/functional/test_urllib2.py
@@ -35,13 +35,13 @@ except ImportError:
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()"
@@ -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"
@@ -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"
@@ -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")
@@ -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"
@@ -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)"
@@ -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()"
@@ -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")