You are on page 1of 16

Software Quality - PROG8440

Assignment 4
Use Postman and generate ten (10) unique API calls (using a different
route each time).
1) Get global COVID-19 totals for today, yesterday and two days ago
URL: https://disease.sh/v3/covid-19/all

Method: GET

2) Get COVID-19 totals for all US States


URL: https://disease.sh/v3/covid-19/states

Method: GET
3) Get COVID-19 totals for specific US State(s)
URL: https://disease.sh/v3/covid-19/states/California

Method: GET
4) Get COVID-19 totals for all continents
URL: https://disease.sh/v3/covid-19/continents

Method: GET
5) Get COVID-19 totals for a specific continent
URL: https://disease.sh/v3/covid-19/continents/ASIA?strict=true

Method: GET

6) Get COVID-19 totals for all countries


URL: https://disease.sh/v3/covid-19/countries

Method: GET
7) Get COVID-19 totals for a specific country
URL: https://disease.sh/v3/covid-19/countries/India?strict=true

Method: GET
8) Get COVID-19 totals for a specific set of countries
URL: https://disease.sh/v3/covid-19/countries/India%2C%20Canada

Method: GET

9) Get COVID-19 totals for all countries and their provinces

URL: https://disease.sh/v3/covid-19/jhucsse

Method: GET
10) Get COVID-19 time series data for all states, with an entry for each day since the pandemic
began

URL: https://disease.sh/v3/covid-19/nyt/states?lastdays=30

Method: GET
Create and run Python scripts of the above

1) Get global COVID-19 totals for today, yesterday and two days ago
import requests
url = "https://disease.sh/v3/covid-19/all"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)

2) Get COVID-19 totals for all US States


import requests
url = "https://disease.sh/v3/covid-19/states"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)

3) Get COVID-19 totals for specific US State(s)


import requests
url = "https://disease.sh/v3/covid-19/states/California"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)
4) Get COVID-19 totals for all continents
import requests
url = "https://disease.sh/v3/covid-19/continents"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)

5) Get COVID-19 totals for a specific continent


import requests
url = "https://disease.sh/v3/covid-19/continents/ASIA"
querystring = {"strict":"true"}
headers = {}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)

6) Get COVID-19 totals for all countries


import requests
url = "https://disease.sh/v3/covid-19/countries"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)

7) Get COVID-19 totals for a specific country


import requests
url = "https://disease.sh/v3/covid-19/countries/India"
querystring = {"strict":"true"}
headers = {}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)

8) Get COVID-19 totals for a specific set of countries


import requests
url = "https://disease.sh/v3/covid-19/countries/India%2C%20Canada"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)

9) Get COVID-19 totals for all countries and their provinces


import requests
url = "https://disease.sh/v3/covid-19/jhucsse"
headers = {}
response = requests.request("GET", url, headers=headers)
print(response.text)
10) Get COVID-19 time series data for all states, with an entry for each day since the pandemic began
import requests
url = "https://disease.sh/v3/covid-19/nyt/states"
querystring = {"lastdays":"30"}
headers = {}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)

PyTest
1) test_covid_status.py

2) test_covid_states.py

3) test_covid_states_single.py
4) test_covid_contenent.py

5) test_covid_contenent_Asia.py

6) test_covid_countries.py

7) test_covid_countries_India.py
8) test_covid_countries_India_Canada

9) test_covid_jhucsse.py

10) test_covid_nyt_states.py

11) test_covid_gov.py
12) test_covid_gov_Canada

13) test_covid_apple_countries

14) test_covid_apple_countries_India

15) test_covid_apple_countries_India_Delhi.py
16) test_covid_jhucsse_country.py

17) test_covid_jhucsse_country_US.py

18) test_covid_hist.py
19) test_covid_hist_alabama.py

20) test_covid_historical.py (Failing Test)

You might also like