Beispiel #1
0
 def test_delay_response(self):
     reqres = Reqres()
     r, d = reqres.get('/api/users?delay=3')
     reqres.verify(r.status_code, 200)
     reqres.verify(d['data'])
     reqres.verify(d['page'], 1)
     reqres.is_failed()
Beispiel #2
0
 def test_get_all_users(self):
     reqres = Reqres()
     r, d = reqres.get('/api/users')
     reqres.verify(r.status_code, 200)
     reqres.verify(d['page'], 1)
     reqres.verify(d['data'])
     reqres.verify(d['data'][0]['id'], 1)
     reqres.verify(d['data'][0]['email'], '*****@*****.**')
     reqres.verify(d['data'][0]['first_name'], 'George')
     reqres.verify(d['data'][0]['last_name'], 'Bluth')
     reqres.is_failed()
Beispiel #3
0
 def test_login(self):
     reqres = Reqres()
     r, _ = reqres.post('/api/login', {'email': '*****@*****.**', 'password': '******'})
     reqres.verify(r.status_code, 200)
     reqres.is_failed()
Beispiel #4
0
 def test_login_negative(self):
     reqres = Reqres()
     r, _ = reqres.post('/api/login', {'email': '*****@*****.**'})
     reqres.verify(r.status_code, 400)
     reqres.is_failed()
Beispiel #5
0
 def test_delete_user(self):
     reqres = Reqres()
     r, _ = reqres.delete('/api/users/2')
     reqres.verify(r.status_code, 204)
     reqres.is_failed()
Beispiel #6
0
 def test_update_user(self):
     reqres = Reqres()
     r, _ = reqres.put('/api/users/5', UpdateUser().get_user_data())
     reqres.verify(r.status_code, 200)
     reqres.is_failed()
Beispiel #7
0
 def test_create_user(self):
     reqres = Reqres()
     r, _ = reqres.post('/api/users', FullUser().get_user_data())
     reqres.verify(r.status_code, 200)
     reqres.is_failed()
Beispiel #8
0
 def test_get_unknown_user(self):
     reqres = Reqres()
     r, _ = reqres.get('/api/users/999999')
     reqres.verify(r.status_code, 404)
     reqres.is_failed()
    def test_check_users_schema(self):
        reqres = Reqres()
        _, d = reqres.get('/api/users')
        reqres.verify_json_schema(d, 'users.json')

        reqres.is_failed()