diff --git a/irctest/client_mock.py b/irctest/client_mock.py index e781929..da82379 100644 --- a/irctest/client_mock.py +++ b/irctest/client_mock.py @@ -30,7 +30,7 @@ class ClientMock: self.sendLine('PING {}'.format(token)) got_pong = False data = b'' - messages = [] + (self.inbuffer, messages) = ([], self.inbuffer) conn = self.conn while not got_pong: try: diff --git a/irctest/specifications.py b/irctest/specifications.py new file mode 100644 index 0000000..01c9f39 --- /dev/null +++ b/irctest/specifications.py @@ -0,0 +1,16 @@ +import enum + +@enum.unique +class Specifications(enum.Enum): + RFC1459 = 'RFC1459' + RFC2812 = 'RFC2812' + IRC301 = 'IRCv3.1' + IRC302 = 'IRCv3.2' + + @classmethod + def of_name(cls, name): + name = name.upper() + for spec in cls: + if spec.value.upper() == name: + return spec + raise ValueError(name)