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

[WIP] Proposed changes for V1 restapi helpers #473

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

andrewhand
Copy link
Collaborator

Move validation for expected content to helpers file

Copy link
Collaborator

@keithmanville keithmanville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the try/except ValueError with message pattern provide the most informative message in pytest? i.e. is it adding something over just having the sequence of asserts?

I tested this on my in progress queues branch and it works (after making the suggested changes with group_ref.

I like breaking the repeated chunks into helpers.

I suggest we get users/groups merged into dev, thenre base this and integrate the new pattern into test_user and test_group before merging this PR.

assert isinstance(group_ref["group"]["name"], str)
assert isinstance(group_ref["group"]["url"], str)
assert group_ref["id"] == expected_contents["group"]["id"]
return True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group_ref doesn't have a "group" key. Should just be group_ref["name"] etc.

assert isinstance(response["latestSnapshot"], bool)
except ValueError("Response keys do not match expected keys types"):
return False

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

black caught some extra whitespace characters here and a couple other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants