annotate libervia/backend/test/test_helpers_plugins.py @ 4240:79c8a70e1813

backend, frontend: prepare remote control: This is a series of changes necessary to prepare the implementation of remote control feature: - XEP-0166: add a `priority` attribute to `ApplicationData`: this is needed when several applications are working in a same session, to know which one must be handled first. Will be used to make Remote Control have precedence over Call content. - XEP-0166: `_call_plugins` is now async and is not used with `DeferredList` anymore: the benefit to have methods called in parallels is very low, and it cause a lot of trouble as we can't predict order. Methods are now called sequentially so workflow can be predicted. - XEP-0167: fix `senders` XMPP attribute <=> SDP mapping - XEP-0234: preflight acceptance key is now `pre-accepted` instead of `file-accepted`, so the same key can be used with other jingle applications. - XEP-0167, XEP-0343: move some method to XEP-0167 - XEP-0353: use new `priority` feature to call preflight methods of applications according to it. - frontend (webrtc): refactor the sources/sink handling with a more flexible mechanism based on Pydantic models. It is now possible to have has many Data Channel as necessary, to have them in addition to A/V streams, to specify manually GStreamer sources and sinks, etc. - frontend (webrtc): rework of the pipeline to reduce latency. - frontend: new `portal_desktop` method. Screenshare portal handling has been moved there, and RemoteDesktop portal has been added. - frontend (webrtc): fix `extract_ufrag_pwd` method. rel 436
author Goffi <goffi@goffi.org>
date Sat, 11 May 2024 13:52:41 +0200
parents 4b842c1fb686
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
1 #!/usr/bin/env python3
3137
559a625a236b fixed shebangs
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
2
794
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
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
5 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
1766
d17772b0fe22 copyright update
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
6 # Copyright (C) 2013-2016 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
4071
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
23 from libervia.backend.test import helpers
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
24 from libervia.backend.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 def setUp(self):
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
29 self.host = helpers.FakeSAT()
52c4b755aba6 test: make FakeClient profile dependent and add some tools to test MUC
souliane <souliane@mailoo.org>
parents:
diff changeset
30 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
31
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
32 def test_join_room(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
33 self.plugin.join_room(0, 0)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
34 self.assertEqual("test", self.plugin.get_nick(0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
35 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
36 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
37 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
38 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
39 self.assertEqual("", self.plugin.get_nick(0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
40 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
41 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
42 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
43 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
44 self.assertEqual("", self.plugin.get_nick(0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
45 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
46 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
47 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
48 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
49 self.assertEqual("", self.plugin.get_nick(0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
50 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
51 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
52 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
53 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
54 self.plugin.join_room(0, 1)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
55 self.assertEqual("test", self.plugin.get_nick(0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
56 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
57 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
58 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
59 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
60 self.assertEqual("sender", self.plugin.get_nick(0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
61 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
62 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
63 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
64 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
65 self.assertEqual("", self.plugin.get_nick(0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
66 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
67 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
68 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
69 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
70 self.assertEqual("", self.plugin.get_nick(0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
71 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
72 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
73 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
74 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
75 self.plugin.join_room(0, 2)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
76 self.assertEqual("test", self.plugin.get_nick(0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
77 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
78 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
79 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
80 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
81 self.assertEqual("sender", self.plugin.get_nick(0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
82 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 1))
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
83 self.assertEqual(
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
84 "sender", self.plugin.get_nick_of_user(0, 1, 1)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
85 ) # Const.JID[2] is in the roster for Const.PROFILE[1]
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
86 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
87 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
88 self.assertEqual("sender", self.plugin.get_nick(0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
89 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
90 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 2))
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
91 self.assertEqual(
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
92 "sender", self.plugin.get_nick_of_user(0, 2, 2)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
93 ) # Const.JID[1] is in the roster for Const.PROFILE[2]
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
94 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
95 self.assertEqual("", self.plugin.get_nick(0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
96 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
97 self.assertEqual(None, self.plugin.get_nick_of_user(0, 1, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
98 self.assertEqual(None, self.plugin.get_nick_of_user(0, 2, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
99 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
100 self.plugin.join_room(0, 3)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
101 self.assertEqual("test", self.plugin.get_nick(0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
102 self.assertEqual(None, self.plugin.get_nick_of_user(0, 0, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
103 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
104 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
105 self.assertEqual("sender_", self.plugin.get_nick_of_user(0, 3, 0))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
106 self.assertEqual("sender", self.plugin.get_nick(0, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
107 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 1))
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
108 self.assertEqual(
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
109 "sender", self.plugin.get_nick_of_user(0, 1, 1)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
110 ) # Const.JID[2] is in the roster for Const.PROFILE[1]
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
111 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
112 self.assertEqual("sender_", self.plugin.get_nick_of_user(0, 3, 1))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
113 self.assertEqual("sender", self.plugin.get_nick(0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
114 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
115 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 2))
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
116 self.assertEqual(
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
117 "sender", self.plugin.get_nick_of_user(0, 2, 2)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
118 ) # Const.JID[1] is in the roster for Const.PROFILE[2]
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
119 self.assertEqual("sender_", self.plugin.get_nick_of_user(0, 3, 2))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
120 self.assertEqual("sender_", self.plugin.get_nick(0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
121 self.assertEqual("test", self.plugin.get_nick_of_user(0, 0, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
122 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 1, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
123 self.assertEqual("sender", self.plugin.get_nick_of_user(0, 2, 3))
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
124 self.assertEqual(None, self.plugin.get_nick_of_user(0, 3, 3))