update to reflect changes in the skill setting repository

pull/159/head
Chris Veilleux 2019-05-23 22:28:03 -05:00
parent d9d66a6ac8
commit 49c8740b42
1 changed files with 8 additions and 6 deletions

View File

@ -5,7 +5,7 @@ from behave import when, then, given
from hamcrest import assert_that, equal_to, not_none, is_not
from selene.api.etag import ETagManager, device_skill_etag_key
from selene.data.skill import SkillSettingRepository
from selene.data.skill import AccountSkillSetting, SkillSettingRepository
from selene.util.db import connect_to_db
skill = {
@ -100,14 +100,16 @@ def create_skill_settings(context):
@when('the skill settings are updated')
def update_skill(context):
update_settings = [{
'settingsValues': new_settings,
'devices': [context.device_name]
}]
update_settings = [AccountSkillSetting(
settings_display={},
settings_values=new_settings,
devices=[context.device_name]
)]
response = json.loads(context.upload_device_response.data)
skill_id = response['uuid']
db = connect_to_db(context.client_config['DB_CONNECTION_CONFIG'])
SkillSettingRepository(db).update_device_skill_settings(skill_id, update_settings)
skill_setting_repo = SkillSettingRepository(db, context.account.id)
skill_setting_repo.update_skill_settings(skill_id, update_settings)
@when('the skill settings is fetched')