Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion b2sdk/_internal/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ def __str__(self):
class TooManyRequests(B2Error):
def __init__(self, retry_after_seconds=None):
super().__init__()
self.retry_after_seconds = retry_after_seconds

if retry_after_seconds is not None:
self.retry_after_seconds = int(retry_after_seconds)
else:
self.retry_after_seconds = None

def __str__(self):
return 'Too many requests'
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+b2http_tests_refactor.infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Redesign `b2http` unit tests utilizing sentry `responses` library for mocking out the `requests` package.
1 change: 1 addition & 0 deletions changelog.d/+retry-after-type-error.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix type error in retrying behavior for 429 status with Retry-After header value set.
1,645 changes: 925 additions & 720 deletions pdm.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ authorized_licenses = [
"bsd license",
"new bsd license",
"simplified bsd",
'bsd-3-clause',
"apache",
"apache 2.0",
"apache software",
Expand Down Expand Up @@ -173,6 +174,7 @@ test = [
"eval_type_backport>=0.1.3,<1; python_version<'3.10'", # used with pydantic
"pydantic>=2.0.1",
"pywin32>=306; sys_platform == \"win32\" and platform_python_implementation!='PyPy'",
"responses",
]
release = [
"towncrier==23.11.0; python_version>='3.8'",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
######################################################################


pytest_plugins = ["b2sdk.v3.testing"]
pytest_plugins = ['b2sdk.v3.testing']
Loading