Browse Source

dont use reserved attribute

dave/xdcc
dave 4 years ago
parent
commit
650ff6f3ef
  1. 4
      pyircbot/modules/Rejoin.py
  2. 3
      tests/modules/test_dcc.py

4
pyircbot/modules/Rejoin.py

@ -16,14 +16,14 @@ class Rejoin(ModuleBase):
def __init__(self, bot, moduleName):
ModuleBase.__init__(self, bot, moduleName)
try:
self.services = self.bot.getmodulesbyservice("services").pop()
self._services = self.bot.getmodulesbyservice("services").pop()
except KeyError as ke:
raise Exception("No services service provider found") from ke
@hook("KICK")
def kicked(self, msg, cmd):
channel, who = msg.args
if who == self.services.nick():
if who == self._services.nick():
Thread(target=self.rejoin, args=(self.config.get("delay", 30), channel)).start()
def rejoin(self, delay, channel):

3
tests/modules/test_dcc.py

@ -32,6 +32,7 @@ def _make_test_tempfiles(length, basedir):
return tmpfpath, srchash
@pytest.mark.slow
def test_offerrecv(dccbot, tmpdir):
# allocate a temp file
flen = 1024 * 51
@ -55,6 +56,7 @@ def test_offerrecv(dccbot, tmpdir):
assert d.hexdigest() == srchash, "file was mangled in transfer"
@pytest.mark.slow
def test_tooshortfails(dccbot, tmpdir):
# allocate a temp file
flen = 1024 * 51
@ -80,6 +82,7 @@ def test_tooshortfails(dccbot, tmpdir):
raise Exception("Did not raise")
@pytest.mark.slow
def test_toolongfails(dccbot, tmpdir):
# allocate a temp file
flen = 1024 * 51

Loading…
Cancel
Save