import yaml
def test_1():
with open("testcase.yaml", 'r',encoding="utf-8") as f:
datas = yaml.load(f, Loader=yaml.FullLoader)
for data in datas:
# print(data)
print(data["test"]["name"])
print(data["test"]["url"])
# Test using included Django test app
# First install python-django
# Then launch the app in another terminal by doing
# cd testapp
# python manage.py testserver test_data.json
# Once launched, tests can be executed via:
# python resttest.py http://localhost:8000 miniapp-test.yaml
#---
#- config:
# - testset: "Tests using test app"
- test: # create entity
name: "Basic get"
url: "/api/person/"
- test: # create entity
name: "Get single person"
url: "/api/person/1/"
- test: # create entity
name: "Get single person"
url: "/api/person/1/"
method: 'DELETE'