annotate src/test/test_helpers_plugins.py @ 1265:e3a9ea76de35 frontends_multi_profiles

quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p): This refactoring allow primitivus to manage correctly several profiles at once, with various other improvments: - profile_manager can now plug several profiles at once, requesting password when needed. No more profile plug specific method is used anymore in backend, instead a "validated" key is used in actions - Primitivus widget are now based on a common "PrimitivusWidget" classe which mainly manage the decoration so far - all widgets are treated in the same way (contactList, Chat, Progress, etc), no more chat_wins specific behaviour - widgets are created in a dedicated manager, with facilities to react on new widget creation or other events - quick_frontend introduce a new QuickWidget class, which aims to be as generic and flexible as possible. It can manage several targets (jids or something else), and several profiles - each widget class return a Hash according to its target. For example if given a target jid and a profile, a widget class return a hash like (target.bare, profile), the same widget will be used for all resources of the same jid - better management of CHAT_GROUP mode for Chat widgets - some code moved from Primitivus to QuickFrontend, the final goal is to have most non backend code in QuickFrontend, and just graphic code in subclasses - no more (un)escapePrivate/PRIVATE_PREFIX - contactList improved a lot: entities not in roster and special entities (private MUC conversations) are better managed - resources can be displayed in Primitivus, and their status messages - profiles are managed in QuickFrontend with dedicated managers This is work in progress, other frontends are broken. Urwid SàText need to be updated. Most of features of Primitivus should work as before (or in a better way ;))
author Goffi <goffi@goffi.org>
date Wed, 10 Dec 2014 19:00:09 +0100
parents e99b6dfd567b
children 069ad98b360d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
794
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
1 #!/usr/bin/python
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
3
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
4 # SAT: a jabber client
811
1fe00f0c9a91 dates update
Goffi <goffi@goffi.org>
parents: 794
diff changeset
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jérôme Poisson (goffi@goffi.org)
1fe00f0c9a91 dates update
Goffi <goffi@goffi.org>
parents: 794
diff changeset
6 # Copyright (C) 2013, 2014 Adrien Cossa (souliane@mailoo.org)
794
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
7
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
8 # This program is free software: you can redistribute it and/or modify
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
9 # it under the terms of the GNU Affero General Public License as published by
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
10 # the Free Software Foundation, either version 3 of the License, or
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
11 # (at your option) any later version.
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
12
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful,
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
16 # GNU Affero General Public License for more details.
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
17
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
20
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
21 """ Test the helper classes to see if they behave well"""
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
22
996
e99b6dfd567b tests: fixed import in test_helpers_plugins
Goffi <goffi@goffi.org>
parents: 811
diff changeset
23 from sat.test import helpers
e99b6dfd567b tests: fixed import in test_helpers_plugins
Goffi <goffi@goffi.org>
parents: 811
diff changeset
24 from sat.test import helpers_plugins
794
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
25
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
26
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
27 class FakeXEP_0045Test(helpers.SatTestCase):
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
28
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
29 def setUp(self):
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
30 self.host = helpers.FakeSAT()
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
31 self.plugin = helpers_plugins.FakeXEP_0045(self.host)
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
32
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
33 def test_joinRoom(self):
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
34 self.plugin.joinRoom(0, 0)
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
35 self.assertEqual('test', self.plugin.getNick(0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
36 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
37 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
38 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
39 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
40 self.assertEqual('', self.plugin.getNick(0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
41 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
42 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
43 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
44 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
45 self.assertEqual('', self.plugin.getNick(0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
46 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
47 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
48 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
49 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
50 self.assertEqual('', self.plugin.getNick(0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
51 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
52 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
53 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
54 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
55 self.plugin.joinRoom(0, 1)
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
56 self.assertEqual('test', self.plugin.getNick(0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
57 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
58 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
59 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
60 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
61 self.assertEqual('sender', self.plugin.getNick(0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
62 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
63 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
64 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
65 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
66 self.assertEqual('', self.plugin.getNick(0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
67 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
68 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
69 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
70 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
71 self.assertEqual('', self.plugin.getNick(0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
72 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
73 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
74 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
75 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
76 self.plugin.joinRoom(0, 2)
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
77 self.assertEqual('test', self.plugin.getNick(0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
78 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
79 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
80 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
81 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
82 self.assertEqual('sender', self.plugin.getNick(0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
83 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
84 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 1)) # Const.JID[2] is in the roster for Const.PROFILE[1]
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
85 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
86 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
87 self.assertEqual('sender', self.plugin.getNick(0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
88 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
89 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
90 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 2)) # Const.JID[1] is in the roster for Const.PROFILE[2]
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
91 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
92 self.assertEqual('', self.plugin.getNick(0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
93 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
94 self.assertEqual(None, self.plugin.getNickOfUser(0, 1, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
95 self.assertEqual(None, self.plugin.getNickOfUser(0, 2, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
96 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
97 self.plugin.joinRoom(0, 3)
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
98 self.assertEqual('test', self.plugin.getNick(0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
99 self.assertEqual(None, self.plugin.getNickOfUser(0, 0, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
100 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
101 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
102 self.assertEqual('sender_', self.plugin.getNickOfUser(0, 3, 0))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
103 self.assertEqual('sender', self.plugin.getNick(0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
104 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
105 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 1)) # Const.JID[2] is in the roster for Const.PROFILE[1]
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
106 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
107 self.assertEqual('sender_', self.plugin.getNickOfUser(0, 3, 1))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
108 self.assertEqual('sender', self.plugin.getNick(0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
109 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
110 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
111 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 2)) # Const.JID[1] is in the roster for Const.PROFILE[2]
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
112 self.assertEqual('sender_', self.plugin.getNickOfUser(0, 3, 2))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
113 self.assertEqual('sender_', self.plugin.getNick(0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
114 self.assertEqual('test', self.plugin.getNickOfUser(0, 0, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
115 self.assertEqual('sender', self.plugin.getNickOfUser(0, 1, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
116 self.assertEqual('sender', self.plugin.getNickOfUser(0, 2, 3))
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
117 self.assertEqual(None, self.plugin.getNickOfUser(0, 3, 3))