From 7464007b8c1b4b5679a2b2ecf934953c8bbcaab1 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 31 Jul 2015 18:50:02 +0200 Subject: [PATCH] add identmap tests --- tests/test_ident_map.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_ident_map.py diff --git a/tests/test_ident_map.py b/tests/test_ident_map.py new file mode 100644 index 0000000..37ecf44 --- /dev/null +++ b/tests/test_ident_map.py @@ -0,0 +1,19 @@ +from tsstats import Clients, Client + +ident_map = { + 1: 2, + 5: 2, + 'UID1': 'UID2', + 'UID5': 'UID2' +} +clients = Clients(ident_map) + + +def test_get_id(): + assert clients[1].identifier == 2 + assert clients[5].identifier == 2 + + +def test_get_uid(): + assert clients['UID1'].identifier == 'UID2' + assert clients['UID5'].identifier == 'UID2'