Created
March 14, 2018 09:43
-
-
Save remyleone/08242746faf4252a835faed0eaf86c22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Testing for account API | |
| """ | |
| import os | |
| import requests | |
| token = os.getenv('SCW_TOKEN', "Insert your API Token here if you don't want to define environment variable") | |
| def test_get_token(): | |
| """ | |
| This will give you the token available for your account. | |
| """ | |
| r = requests.get("https://account.scaleway.com/tokens", | |
| headers={'X-Auth-Token': token, | |
| "Content-Type": "application/json"}) | |
| print(r.text) | |
| assert r.ok | |
| def test_post_token(): | |
| r = requests.post("https://account.scaleway.com/tokens", | |
| headers={'X-Auth-Token': token, | |
| "Content-Type": "application/json"}) | |
| print(r.text) | |
| assert r.ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment