Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test: fix usage of tick function so g3 tests can pass #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions 16 tests/transport/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ def test_request_refresh(self):
assert adapter.requests[1].headers["authorization"] == "token1"

def test_request_max_allowed_time_timeout_error(self, frozen_time):
tick_one_second = functools.partial(frozen_time.tick, delta=1.0)
tick_one_second = functools.partial(
frozen_time.tick, delta=datetime.timedelta(seconds=1.0)
)

credentials = mock.Mock(
wraps=TimeTickCredentialsStub(time_tick=tick_one_second)
Expand All @@ -286,7 +288,9 @@ def test_request_max_allowed_time_timeout_error(self, frozen_time):
authed_session.request("GET", self.TEST_URL, max_allowed_time=0.9)

def test_request_max_allowed_time_w_transport_timeout_no_error(self, frozen_time):
tick_one_second = functools.partial(frozen_time.tick, delta=1.0)
tick_one_second = functools.partial(
frozen_time.tick, delta=datetime.timedelta(seconds=1.0)
)

credentials = mock.Mock(
wraps=TimeTickCredentialsStub(time_tick=tick_one_second)
Expand All @@ -308,7 +312,9 @@ def test_request_max_allowed_time_w_transport_timeout_no_error(self, frozen_time
authed_session.request("GET", self.TEST_URL, timeout=0.5, max_allowed_time=3.1)

def test_request_max_allowed_time_w_refresh_timeout_no_error(self, frozen_time):
tick_one_second = functools.partial(frozen_time.tick, delta=1.0)
tick_one_second = functools.partial(
frozen_time.tick, delta=datetime.timedelta(seconds=1.0)
)

credentials = mock.Mock(
wraps=TimeTickCredentialsStub(time_tick=tick_one_second)
Expand All @@ -333,7 +339,9 @@ def test_request_max_allowed_time_w_refresh_timeout_no_error(self, frozen_time):
authed_session.request("GET", self.TEST_URL, timeout=60, max_allowed_time=3.1)

def test_request_timeout_w_refresh_timeout_timeout_error(self, frozen_time):
tick_one_second = functools.partial(frozen_time.tick, delta=1.0)
tick_one_second = functools.partial(
frozen_time.tick, delta=datetime.timedelta(seconds=1.0)
)

credentials = mock.Mock(
wraps=TimeTickCredentialsStub(time_tick=tick_one_second)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.