mirror of https://github.com/progval/irctest.git
ClientMock.getMessages: Reuse the inbuffer.
This commit is contained in:
parent
69203a145d
commit
caa85d25cb
|
@ -30,7 +30,7 @@ class ClientMock:
|
||||||
self.sendLine('PING {}'.format(token))
|
self.sendLine('PING {}'.format(token))
|
||||||
got_pong = False
|
got_pong = False
|
||||||
data = b''
|
data = b''
|
||||||
messages = []
|
(self.inbuffer, messages) = ([], self.inbuffer)
|
||||||
conn = self.conn
|
conn = self.conn
|
||||||
while not got_pong:
|
while not got_pong:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue