mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 06:49:47 +00:00
fix auditorium test, unvoiced users can speak
This commit is contained in:
@ -749,11 +749,12 @@ class AuditoriumTestCase(cases.BaseServerTestCase):
|
|||||||
self.assertEqual(echo_message, self.getMessages('guest2')[0])
|
self.assertEqual(echo_message, self.getMessages('guest2')[0])
|
||||||
self.assertEqual(echo_message, self.getMessages('guest3')[0])
|
self.assertEqual(echo_message, self.getMessages('guest3')[0])
|
||||||
|
|
||||||
|
# unvoiced users can speak
|
||||||
self.sendLine('guest1', 'PRIVMSG #auditorium :hi you')
|
self.sendLine('guest1', 'PRIVMSG #auditorium :hi you')
|
||||||
self.assertMessageEqual(self.getMessages('guest1')[0], command=ERR_CANNOTSENDTOCHAN)
|
echo_message = [msg for msg in self.getMessages('guest1') if msg.command == 'PRIVMSG'][0]
|
||||||
self.assertEqual(len(self.getMessages('bar')), 0)
|
self.assertEqual(self.getMessages('bar'), [echo_message])
|
||||||
self.assertEqual(len(self.getMessages('guest2')), 0)
|
self.assertEqual(self.getMessages('guest2'), [echo_message])
|
||||||
self.assertEqual(len(self.getMessages('guest3')), 0)
|
self.assertEqual(self.getMessages('guest3'), [echo_message])
|
||||||
|
|
||||||
def names(client):
|
def names(client):
|
||||||
self.sendLine(client, 'NAMES #auditorium')
|
self.sendLine(client, 'NAMES #auditorium')
|
||||||
@ -773,15 +774,9 @@ class AuditoriumTestCase(cases.BaseServerTestCase):
|
|||||||
self.assertEqual(self.getMessages('guest1'), [modeLine])
|
self.assertEqual(self.getMessages('guest1'), [modeLine])
|
||||||
self.assertEqual(self.getMessages('guest2'), [modeLine])
|
self.assertEqual(self.getMessages('guest2'), [modeLine])
|
||||||
self.assertEqual(self.getMessages('guest3'), [modeLine])
|
self.assertEqual(self.getMessages('guest3'), [modeLine])
|
||||||
# guest1 is voiced now and can speak
|
self.assertEqual(names('bar'), {'@bar', '+guest1', 'guest2', 'guest3'})
|
||||||
self.sendLine('guest1', 'PRIVMSG #auditorium :hi you')
|
|
||||||
echo_message = [msg for msg in self.getMessages('guest1') if msg.command == 'PRIVMSG'][0]
|
|
||||||
self.assertEqual(echo_message, self.getMessages('bar')[0])
|
|
||||||
self.assertEqual(echo_message, self.getMessages('guest2')[0])
|
|
||||||
self.assertEqual(echo_message, self.getMessages('guest3')[0])
|
|
||||||
|
|
||||||
self.assertEqual(names('guest2'), {'@bar', '+guest1'})
|
|
||||||
self.assertEqual(names('guest2'), {'@bar', '+guest1'})
|
self.assertEqual(names('guest2'), {'@bar', '+guest1'})
|
||||||
|
self.assertEqual(names('guest3'), {'@bar', '+guest1'})
|
||||||
|
|
||||||
self.sendLine('guest1', 'PART #auditorium')
|
self.sendLine('guest1', 'PART #auditorium')
|
||||||
part = [msg for msg in self.getMessages('guest1') if msg.command == 'PART'][0]
|
part = [msg for msg in self.getMessages('guest1') if msg.command == 'PART'][0]
|
||||||
|
Reference in New Issue
Block a user