checking if 2 users find the same computer but registered 2 times

This commit is contained in:
Cayo Puigdefabregas 2020-11-06 21:01:29 +01:00
parent bc5cbb2eff
commit 2055af222d

View file

@ -1,4 +1,5 @@
import pytest
import uuid
from teal.utils import compiled
from ereuse_devicehub.client import UserClient
@ -185,6 +186,26 @@ def test_device_query(user: UserClient):
assert not pc['tags']
@pytest.mark.mvp
def test_device_query_permitions(user: UserClient, user2: UserClient):
"""Checks result of inventory for two users"""
user.post(file('basic.snapshot'), res=Snapshot)
i, _ = user.get(res=Device)
pc1 = next(d for d in i['items'] if d['type'] == 'Desktop')
i2, _ = user2.get(res=Device)
assert i2['items'] == []
basic_snapshot = file('basic.snapshot')
basic_snapshot['uuid'] = f"{uuid.uuid4()}"
user2.post(basic_snapshot, res=Snapshot)
i2, _ = user2.get(res=Device)
pc2 = next(d for d in i2['items'] if d['type'] == 'Desktop')
assert pc1['id'] != pc2['id']
assert pc1['hid'] == pc2['hid']
@pytest.mark.mvp
def test_device_search_all_devices_token_if_empty(app: Devicehub, user: UserClient):
"""Ensures DeviceSearch can regenerate itself when the table is empty."""