示例#1
0
def test_update_entry_with_invalid_data():
    pet_id = create_random_int_inputs()
    test_data = create_pet_entry_data(pet_id=pet_id,
                                      pet_name=create_random_string_inputs(),
                                      pet_photo=[create_random_string_inputs()],
                                      pet_status=randomly_provide_status())
    updated_response = pet_store_operation.update_pet_entry(payload=test_data)
    assert updated_response.status_code == 200
    updated_response = json.loads(updated_response.text)
    check_results(test_data, updated_response)
示例#2
0
def test_just_passing_mandatory_fields():
    pet_id = create_random_int_inputs()
    test_data = create_pet_entry_data(
        pet_id=pet_id,
        pet_name=create_random_string_inputs(),
        pet_photo=[create_random_string_inputs()],
        pet_status=randomly_provide_status())
    response = pet_store_operation.create_pet_entry(payload=test_data)
    assert response.status_code == 200
    response = json.loads(response.text)
    check_results(test_data, response)
示例#3
0
def test_deleting_existing_pet_entry():
    pet_id = create_random_int_inputs()
    test_data = create_pet_entry_data(
        pet_id=pet_id,
        pet_name=create_random_string_inputs(),
        pet_photo=[create_random_string_inputs()],
        pet_status=randomly_provide_status())
    pet_store_operation.create_pet_entry(payload=test_data)
    response = pet_store_operation.delete_pet_entry(pet_id)
    assert response.status_code == 200
    response = pet_store_operation.get_pet_entry(pet_id)
    assert response.status_code == 404
    response = json.loads(response.content)
    assert response['message'] == "Pet not found"
    assert response['type'] == "error"
示例#4
0
def test_deleting_invalid_entry():
    pet_id = create_random_string_inputs()
    response = pet_store_operation.delete_pet_entry(pet_id)
    assert response.status_code == 404