Skip to content

Commit

Permalink
Replace hard coded devices by devices generated from the API
Browse files Browse the repository at this point in the history
To avoid failing tests for future changes in these devices which we
don't control
  • Loading branch information
danielsjf committed Nov 18, 2018
1 parent 1174c2d commit e83e7e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 36 deletions.
15 changes: 4 additions & 11 deletions tests/test_pyawair_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@

from unittest import TestCase
from pyawair.data import *

dev1 = {'deviceId': 0,
'deviceType': 'awair',
'latitude': 123.4567,
'locationName': 'My Home',
'longitude': 123.4567,
'name': 'Bedroom',
'preference': 'GENERAL',
'spaceType': 'HOME',
'timezone': 'US/Pacific'}
from pyawair.auth import AwairAuth
from pyawair.devices import get_all_devices

hobbiest = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktSE9CQllJU1QifQ.hzjhIpGljqCZ8vCrOr89POy_ENDPYQXsnzGslP01krI'
small_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktU01BTExfREVWRUxPUEVSIn0.amOu5uy-0UeBDRLd6uhqsbkUEyx13-4QdBrV1S3z2W8'
large_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktTEFSR0VfREVWRUxPUEVSIn0.JmP9a0eGjgYRlmri5BjNj4h1hlAZ-7yFOjcIZjyzypA'
enterprise_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktRU5URVJQUklTRSJ9.bOM9rcABF9HKFHtxzF9kx8h9fv3CfvUIzveLFDRGrXs'

auth = pyawair.auth.AwairAuth(enterprise_dev)
auth = AwairAuth(enterprise_dev)
dev1 = get_all_devices(auth)[0]

# TODO Remarked out failing tests

Expand Down
18 changes: 4 additions & 14 deletions tests/test_pyawair_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,16 @@

from unittest import TestCase
from pyawair.devices import *
import pyawair.auth



dev1 = {'deviceId': 0,
'deviceType': 'awair',
'latitude': 123.4567,
'locationName': 'My Home',
'longitude': 123.4567,
'name': 'Bedroom',
'preference': 'GENERAL',
'spaceType': 'HOME',
'timezone': 'US/Pacific'}
from pyawair.auth import AwairAuth
from pyawair.devices import get_all_devices

hobbiest = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktSE9CQllJU1QifQ.hzjhIpGljqCZ8vCrOr89POy_ENDPYQXsnzGslP01krI'
small_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktU01BTExfREVWRUxPUEVSIn0.amOu5uy-0UeBDRLd6uhqsbkUEyx13-4QdBrV1S3z2W8'
large_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktTEFSR0VfREVWRUxPUEVSIn0.JmP9a0eGjgYRlmri5BjNj4h1hlAZ-7yFOjcIZjyzypA'
enterprise_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktRU5URVJQUklTRSJ9.bOM9rcABF9HKFHtxzF9kx8h9fv3CfvUIzveLFDRGrXs'

auth = pyawair.auth.AwairAuth(enterprise_dev)
auth = AwairAuth(enterprise_dev)
dev1 = get_all_devices(auth)[0]

# TODO Remarked out failing tests

Expand Down
15 changes: 4 additions & 11 deletions tests/test_pyawair_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@
from unittest import TestCase
from unittest import mock
from pyawair.objects import *

dev1 = {'deviceId': 0,
'deviceType': 'awair',
'latitude': 123.4567,
'locationName': 'My Home',
'longitude': 123.4567,
'name': 'Bedroom',
'preference': 'GENERAL',
'spaceType': 'HOME',
'timezone': 'US/Pacific'}
from pyawair.auth import AwairAuth
from pyawair.devices import get_all_devices

hobbiest = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktSE9CQllJU1QifQ.hzjhIpGljqCZ8vCrOr89POy_ENDPYQXsnzGslP01krI'
small_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktU01BTExfREVWRUxPUEVSIn0.amOu5uy-0UeBDRLd6uhqsbkUEyx13-4QdBrV1S3z2W8'
large_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktTEFSR0VfREVWRUxPUEVSIn0.JmP9a0eGjgYRlmri5BjNj4h1hlAZ-7yFOjcIZjyzypA'
enterprise_dev = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiRFVNTVktRU5URVJQUklTRSJ9.bOM9rcABF9HKFHtxzF9kx8h9fv3CfvUIzveLFDRGrXs'

auth = pyawair.auth.AwairAuth(enterprise_dev)
auth = AwairAuth(enterprise_dev)
dev1 = get_all_devices(auth)[0]

class TestGetCurrentAirData(TestCase):
"""
Expand Down

0 comments on commit e83e7e2

Please sign in to comment.