Created
March 13, 2018 16:52
-
-
Save remyleone/c16caf9d8af5c83e70f1a09fac568510 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