1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-16 07:10:09 -07:00

Move smoke test to its own file

This commit is contained in:
Adrian Sampson 2018-01-06 14:14:36 -08:00
parent 6a2f4321d3
commit 009ed8e330
2 changed files with 19 additions and 0 deletions

18
example.py Normal file
View File

@ -0,0 +1,18 @@
import wideq
def example():
gw = wideq.gateway_info()
oauth_base = gw['empUri']
api_root = gw['thinqUri']
print(wideq.oauth_url(oauth_base))
access_token = wideq.parse_oauth_callback(input())
print(access_token)
session_info = wideq.login(api_root, access_token)
print(session_info)
if __name__ == '__main__':
example()

View File

@ -60,6 +60,7 @@ def login(api_root, access_token):
"""Use an access token to log into the API and obtain a session and
return information about the session.
"""
url = urljoin(api_root + '/', LOGIN_PATH)
req_data = {DATA_ROOT: {
'countryCode': COUNTRY,