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

Simpler Case usage #109

Closed
Stranger6667 opened this issue Oct 3, 2019 · 1 comment
Closed

Simpler Case usage #109

Stranger6667 opened this issue Oct 3, 2019 · 1 comment
Assignees
Labels
Priority: Low Cosmetic or low-impact changes
Milestone

Comments

@Stranger6667
Copy link
Member

Stranger6667 commented Oct 3, 2019

To simplify the current example we can have a method to convert Case instance into a dictionary that could be passed into requests.request.

@schema.parametrize()
def test_no_server_errors(case):
    response = requests.request(**case.as_requests(BASE_URL))
    assert response.status_code < 500

it will save some keystrokes and will make the test shorter. Also, it could be a method on the Case that will include a network call via requests or urllib:

@schema.parametrize()
def test_no_server_errors(case):
    response = case.call(BASE_URL)
    assert response.status_code < 500
@Stranger6667 Stranger6667 added Priority: Low Cosmetic or low-impact changes Type: Enhancement labels Oct 3, 2019
@Stranger6667 Stranger6667 added this to the 0.9.0 milestone Oct 4, 2019
@Stranger6667 Stranger6667 self-assigned this Oct 4, 2019
@Stranger6667 Stranger6667 modified the milestones: 0.9.0, 0.10.0 Oct 9, 2019
@Stranger6667
Copy link
Member Author

Done in 08f0971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Cosmetic or low-impact changes
Projects
None yet
Development

No branches or pull requests

1 participant