Skip to content

Commit

Permalink
Merge pull request #3 from mkudlej/fix_flake_errors
Browse files Browse the repository at this point in the history
fix flake and pylint errors and add black
  • Loading branch information
mkudlej authored Apr 5, 2024
2 parents 4b25ed8 + d81eae9 commit 05297f2
Show file tree
Hide file tree
Showing 28 changed files with 2,630 additions and 1,798 deletions.
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

0 comments on commit 05297f2

Please sign in to comment.