-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
25 lines (19 loc) · 1 KB
/
test.py
File metadata and controls
25 lines (19 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pytest
@pytest.mark.parametrize("api_fixture",
[("get", "https://reqres.in/api/users?page=2"),
("post", "https://reqres.in/api/login", {"email": "eve.holt@reqres.in", "password": "cityslicka"}),
("get", "https://reqres.in/api/users?delay=3")],
indirect=True)
def test_200(api_fixture):
assert api_fixture == 200
@pytest.mark.parametrize("api_fixture",
[("post", "https://reqres.in/api/users", {"name": "morpheus","job": "leader"})],
indirect=True)
def test_201(api_fixture):
assert api_fixture == 201
@pytest.mark.parametrize("api_fixture",
[("post", "https://reqres.in/api/register", {"email": "sydney@fife"}),
("post", "https://reqres.in/api/login", {"email": "peter@klaven"})],
indirect=True)
def test_400(api_fixture):
assert api_fixture == 400