fixing test

This commit is contained in:
Cayo Puigdefabregas 2021-01-19 16:31:01 +01:00
parent f140c48359
commit 7f6014532d

View file

@ -179,7 +179,7 @@ def test_live_export_csv2(user: UserClient, client: Client, app: Devicehub):
def test_live_example2(user: UserClient, client: Client, app: Devicehub): def test_live_example2(user: UserClient, client: Client, app: Devicehub):
"""Tests inserting a Live into the database and GETting it.""" """Tests inserting a Live into the database and GETting it."""
acer = file('acer-happy.snapshot-test1') acer = file('acer-happy.snapshot-test1')
snapshot, _ = user.post(acer, res=models.Snapshot) snapshot, _ = user.post(acer, res=Snapshot)
device_id = snapshot['device']['id'] device_id = snapshot['device']['id']
post_request = {"transaction": "ccc", "name": "John", "endUsers": 1, post_request = {"transaction": "ccc", "name": "John", "endUsers": 1,
"devices": [device_id], "description": "aaa", "devices": [device_id], "description": "aaa",
@ -188,11 +188,11 @@ def test_live_example2(user: UserClient, client: Client, app: Devicehub):
"endTime": "2020-12-01T02:00:00+00:00" "endTime": "2020-12-01T02:00:00+00:00"
} }
user.post(res=models.Allocate, data=post_request) user.post(res=Allocate, data=post_request)
acer = file('acer-happy.live-test1') acer = file('acer-happy.live-test1')
live, _ = client.post(acer, res=models.Live) live, _ = client.post(acer, res=Live)
db_device = Device.query.filter_by(id=device_id).one() db_device = d.Device.query.filter_by(id=device_id).one()
action_live = [a for a in db_device.actions if a.type == 'Live'] action_live = [a for a in db_device.actions if a.type == 'Live']
assert len(action_live) == 1 assert len(action_live) == 1
assert str(action_live[0].snapshot_uuid) == acer['uuid'] assert str(action_live[0].snapshot_uuid) == acer['uuid']