mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 14:59:49 +00:00
Compare commits
4 Commits
dacb4eb517
...
elist-2par
Author | SHA1 | Date | |
---|---|---|---|
6559bb34c0 | |||
67f08fb211 | |||
199d15b434 | |||
b2e8f5d1e1 |
@ -238,6 +238,135 @@ class ListTestCase(_BasedListTestCase):
|
|||||||
self.sendLine(3, "LIST <100")
|
self.sendLine(3, "LIST <100")
|
||||||
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"})
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"})
|
||||||
|
|
||||||
|
@cases.mark_specifications("Modern")
|
||||||
|
def testListTwoChannels(self):
|
||||||
|
"""
|
||||||
|
"Parameters: [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]"
|
||||||
|
-- https://modern.ircdocs.horse/#list-message
|
||||||
|
"""
|
||||||
|
self.connectClient("foo")
|
||||||
|
|
||||||
|
if "TARGMAX" in self.server_support:
|
||||||
|
for item in (self.server_support["TARGMAX"]).split(","):
|
||||||
|
(command, max_) = item.split(":", 1)
|
||||||
|
if command == "LIST" and int(max_ or "1000") < 2:
|
||||||
|
raise runner.OptionalExtensionNotSupported("TARGMAX=LIST >= 2")
|
||||||
|
|
||||||
|
self.sendLine(1, "JOIN #chan1")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan2")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan3")
|
||||||
|
self.getMessages(1)
|
||||||
|
|
||||||
|
self.connectClient("bar")
|
||||||
|
self.sendLine(2, "JOIN #chan2")
|
||||||
|
self.getMessages(2)
|
||||||
|
|
||||||
|
self.connectClient("baz")
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2", "#chan3"})
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST #chan1,#chan2")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"})
|
||||||
|
|
||||||
|
@cases.mark_isupport("ELIST")
|
||||||
|
def testListTwoMasks(self):
|
||||||
|
self.connectClient("foo")
|
||||||
|
|
||||||
|
if "M" not in self.server_support.get("ELIST", ""):
|
||||||
|
raise runner.OptionalExtensionNotSupported("ELIST=M")
|
||||||
|
|
||||||
|
if "TARGMAX" in self.server_support:
|
||||||
|
for item in (self.server_support["TARGMAX"]).split(","):
|
||||||
|
(command, max_) = item.split(":", 1)
|
||||||
|
if command == "LIST" and int(max_ or "1000") < 2:
|
||||||
|
raise runner.OptionalExtensionNotSupported("TARGMAX=LIST >= 2")
|
||||||
|
|
||||||
|
self.sendLine(1, "JOIN #chan1")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan2")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan3")
|
||||||
|
self.getMessages(1)
|
||||||
|
|
||||||
|
self.connectClient("bar")
|
||||||
|
self.sendLine(2, "JOIN #chan2")
|
||||||
|
self.getMessages(2)
|
||||||
|
|
||||||
|
self.connectClient("baz")
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2", "#chan3"})
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST *an1,*an2")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"})
|
||||||
|
|
||||||
|
@cases.mark_isupport("ELIST")
|
||||||
|
@cases.mark_specifications("Modern")
|
||||||
|
def testListTwoParams(self):
|
||||||
|
"""
|
||||||
|
"Parameters: [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]"
|
||||||
|
-- https://modern.ircdocs.horse/#list-message
|
||||||
|
"""
|
||||||
|
self.connectClient("foo")
|
||||||
|
|
||||||
|
if "U" not in self.server_support.get("ELIST", ""):
|
||||||
|
raise runner.OptionalExtensionNotSupported("ELIST=U")
|
||||||
|
|
||||||
|
self.sendLine(1, "JOIN #chan1")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan2")
|
||||||
|
self.getMessages(1)
|
||||||
|
|
||||||
|
self.connectClient("bar")
|
||||||
|
self.sendLine(2, "JOIN #chan2")
|
||||||
|
self.getMessages(2)
|
||||||
|
|
||||||
|
self.connectClient("baz")
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST #chan1 >0")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1"})
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST #chan1 <1")
|
||||||
|
self.assertEqual(self._parseChanList(3), set())
|
||||||
|
|
||||||
|
@cases.mark_isupport("ELIST")
|
||||||
|
@cases.mark_specifications("Modern")
|
||||||
|
def testListTwoParamsTwoChannels(self):
|
||||||
|
"""
|
||||||
|
"Parameters: [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]"
|
||||||
|
-- https://modern.ircdocs.horse/#list-message
|
||||||
|
"""
|
||||||
|
self.connectClient("foo")
|
||||||
|
|
||||||
|
if "U" not in self.server_support.get("ELIST", ""):
|
||||||
|
raise runner.OptionalExtensionNotSupported("ELIST=U")
|
||||||
|
|
||||||
|
if "TARGMAX" in self.server_support:
|
||||||
|
for item in (self.server_support["TARGMAX"]).split(","):
|
||||||
|
(command, max_) = item.split(":", 1)
|
||||||
|
if command == "LIST" and int(max_ or "1000") < 2:
|
||||||
|
raise runner.OptionalExtensionNotSupported("TARGMAX=LIST >= 2")
|
||||||
|
|
||||||
|
self.sendLine(1, "JOIN #chan1")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "JOIN #chan2")
|
||||||
|
self.getMessages(1)
|
||||||
|
|
||||||
|
self.connectClient("bar")
|
||||||
|
self.sendLine(2, "JOIN #chan2")
|
||||||
|
self.getMessages(2)
|
||||||
|
|
||||||
|
self.connectClient("baz")
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST #chan1,#chan2 >0")
|
||||||
|
self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"})
|
||||||
|
|
||||||
|
self.sendLine(3, "LIST #chan1,#chan2 <1")
|
||||||
|
self.assertEqual(self._parseChanList(3), set())
|
||||||
|
|
||||||
|
|
||||||
class FaketimeListTestCase(_BasedListTestCase):
|
class FaketimeListTestCase(_BasedListTestCase):
|
||||||
faketime = "+1y x30" # for every wall clock second, 1 minute passed for the server
|
faketime = "+1y x30" # for every wall clock second, 1 minute passed for the server
|
||||||
|
@ -52,6 +52,7 @@ class Capabilities(enum.Enum):
|
|||||||
|
|
||||||
@enum.unique
|
@enum.unique
|
||||||
class IsupportTokens(enum.Enum):
|
class IsupportTokens(enum.Enum):
|
||||||
|
ACCOUNTEXTBAN = "ACCOUNTEXTBAN"
|
||||||
BOT = "BOT"
|
BOT = "BOT"
|
||||||
ELIST = "ELIST"
|
ELIST = "ELIST"
|
||||||
INVEX = "INVEX"
|
INVEX = "INVEX"
|
||||||
|
@ -34,6 +34,7 @@ markers =
|
|||||||
sts
|
sts
|
||||||
|
|
||||||
# isupport tokens
|
# isupport tokens
|
||||||
|
ACCOUNTEXTBAN
|
||||||
BOT
|
BOT
|
||||||
ELIST
|
ELIST
|
||||||
INVEX
|
INVEX
|
||||||
|
Reference in New Issue
Block a user