fixed tests still using the old connection pool
parent
00be679ad4
commit
7c96bde026
|
@ -6,7 +6,7 @@ from hamcrest import assert_that, equal_to, not_none, is_not
|
||||||
|
|
||||||
from selene.api.etag import ETagManager, device_skill_etag_key
|
from selene.api.etag import ETagManager, device_skill_etag_key
|
||||||
from selene.data.skill import SkillSettingRepository
|
from selene.data.skill import SkillSettingRepository
|
||||||
from selene.util.db import get_db_connection
|
from selene.util.db import connect_to_db
|
||||||
|
|
||||||
skill = {
|
skill = {
|
||||||
'skill_gid': 'wolfram-alpha|19.02',
|
'skill_gid': 'wolfram-alpha|19.02',
|
||||||
|
@ -106,8 +106,8 @@ def update_skill(context):
|
||||||
}]
|
}]
|
||||||
response = json.loads(context.upload_device_response.data)
|
response = json.loads(context.upload_device_response.data)
|
||||||
skill_id = response['uuid']
|
skill_id = response['uuid']
|
||||||
with get_db_connection(context.client_config['DB_CONNECTION_POOL']) as db:
|
db = connect_to_db(context.client_config['DB_CONNECTION_CONFIG'])
|
||||||
SkillSettingRepository(db).update_device_skill_settings(skill_id, update_settings)
|
SkillSettingRepository(db).update_device_skill_settings(skill_id, update_settings)
|
||||||
|
|
||||||
|
|
||||||
@when('the skill settings is fetched')
|
@when('the skill settings is fetched')
|
||||||
|
|
|
@ -7,7 +7,7 @@ from behave import when, then
|
||||||
from hamcrest import assert_that, has_entry, equal_to
|
from hamcrest import assert_that, has_entry, equal_to
|
||||||
|
|
||||||
from selene.data.account import AccountRepository, AccountMembership
|
from selene.data.account import AccountRepository, AccountMembership
|
||||||
from selene.util.db import get_db_connection
|
from selene.util.db import connect_to_db
|
||||||
|
|
||||||
|
|
||||||
@when('the subscription endpoint is called')
|
@when('the subscription endpoint is called')
|
||||||
|
@ -42,9 +42,9 @@ def get_device_subscription(context):
|
||||||
login = context.device_login
|
login = context.device_login
|
||||||
device_id = login['uuid']
|
device_id = login['uuid']
|
||||||
access_token = login['accessToken']
|
access_token = login['accessToken']
|
||||||
headers=dict(Authorization='Bearer {token}'.format(token=access_token))
|
headers = dict(Authorization='Bearer {token}'.format(token=access_token))
|
||||||
with get_db_connection(context.client_config['DB_CONNECTION_POOL']) as db:
|
db = connect_to_db(context.client_config['DB_CONNECTION_CONFIG'])
|
||||||
AccountRepository(db).add_membership(context.account.id, membership)
|
AccountRepository(db).add_membership(context.account.id, membership)
|
||||||
context.subscription_response = context.client.get(
|
context.subscription_response = context.client.get(
|
||||||
'/v1/device/{uuid}/subscription'.format(uuid=device_id),
|
'/v1/device/{uuid}/subscription'.format(uuid=device_id),
|
||||||
headers=headers
|
headers=headers
|
||||||
|
|
Loading…
Reference in New Issue