Skip to content
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

fix flake and pylint errors and add black #3

Merged
merged 1 commit into from
Apr 5, 2024
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
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flake8 = "*"
mypy = "*"
pylint = "*"
black = "*"
pytest = "<8.0.0"
python-dotenv = "*"
backoff = "*"
Expand Down
18 changes: 12 additions & 6 deletions tests/integration/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@ def assert_resource(resource: threescale_api.defaults.DefaultResource):
assert resource.entity is not None


def assert_errors_contains(resource: threescale_api.defaults.DefaultClient, fields: List[str]):
errors = resource['errors']
def assert_errors_contains(
resource: threescale_api.defaults.DefaultClient, fields: List[str]
):
errors = resource["errors"]
assert errors is not None
for field in fields:
assert field in errors


def assert_resource_params(obj: threescale_api.defaults.DefaultResource, params: dict, allowed=None):
for (key, val) in params.items():
def assert_resource_params(
obj: threescale_api.defaults.DefaultResource, params: dict, allowed=None
):
for key, val in params.items():
if allowed is not None and key in allowed:
assert obj[key] == val, f"Resource value for key \"{key}\" should be correct."
assert obj.entity[key] == val, "Entity value for key \"{key}\" should be correct."
assert obj[key] == val, f'Resource value for key "{key}" should be correct.'
assert (
obj.entity[key] == val
), 'Entity value for key "{key}" should be correct.'


def assert_http_ok(response: requests.Response):
Expand Down
Loading
Loading