TeamspeakStats/tsstats/tests/test_ident_map.py

27 lines
603 B
Python
Raw Normal View History

import pytest
from tsstats.client import Client, Clients
2015-07-31 12:50:02 -04:00
@pytest.fixture(scope='module')
def identmap_clients():
clients = Clients({
'1': '2',
'5': '2',
'UID1': 'UID2',
'UID5': 'UID2'
})
cl = Client('2', 'Client2')
uidcl = Client('UID2', 'Client2++')
clients += cl
clients += uidcl
return (clients, cl, uidcl)
2015-07-31 12:50:02 -04:00
def test_ident_map(identmap_clients):
clients, cl, uidcl = identmap_clients
assert clients['1'] == cl
assert clients['5'] == cl
assert clients['UID1'] == uidcl
assert clients['UID5'] == uidcl