Skip to content

Instantly share code, notes, and snippets.

@alexmoleiro
Created January 15, 2019 14:19
Show Gist options
  • Save alexmoleiro/e5de9fee40342ee049a2359bff91cf45 to your computer and use it in GitHub Desktop.
Save alexmoleiro/e5de9fee40342ee049a2359bff91cf45 to your computer and use it in GitHub Desktop.
Smoke tests
import requests
# given
environment = "pro"
token = ''
headers = {
'Authorization': token,
'Content-type': 'application/json; charset=utf-8'
}
url_asgard = "http://asgard.classified-ads-" + environment + ".spain.schibsted.io:8080/eu-west-1/cluster/show/ms_pta__adinsertion.json"
url_public_dns_name = requests.get(url_asgard).json()[0]["instances"][0]["publicDnsName"]
url_get_drafts = "http://" + url_public_dns_name + ":8000/cochesnet/drafts/"
# when
url_drafts = requests.get(url_get_drafts, headers=headers)
# assert
print(url_drafts.status_code)
# print results
print("Test: PtaAdInsertion /cochesnet/drafts/ --> GET")
print("Kibana PRE: https://goo.gl/9h5mka")
print(url_get_drafts)
print(url_drafts.json())
print(url_drafts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment