mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 13:01:07 -05:00
RelayNext: fix tests on py3.6
This commit is contained in:
parent
3b917e7221
commit
c4ea611726
@ -31,6 +31,7 @@ import random
|
|||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
import time
|
import time
|
||||||
|
import typing
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from supybot.test import *
|
from supybot.test import *
|
||||||
@ -518,7 +519,8 @@ class RelayNextTestCase(PluginTestCase):
|
|||||||
output = self.getCommandResponse(self.irc2)
|
output = self.getCommandResponse(self.irc2)
|
||||||
print("Expected:", expected_msg)
|
print("Expected:", expected_msg)
|
||||||
print("Actual:", output)
|
print("Actual:", output)
|
||||||
if isinstance(expected_msg, re.Pattern):
|
# https://stackoverflow.com/a/34178375
|
||||||
|
if isinstance(expected_msg, typing.Pattern):
|
||||||
self.assertRegex(output.args[1], expected_msg)
|
self.assertRegex(output.args[1], expected_msg)
|
||||||
else:
|
else:
|
||||||
self.assertIn(expected_msg, output.args[1])
|
self.assertIn(expected_msg, output.args[1])
|
||||||
@ -549,7 +551,8 @@ class RelayNextTestCase(PluginTestCase):
|
|||||||
output = self.getCommandResponse(self.irc2)
|
output = self.getCommandResponse(self.irc2)
|
||||||
print("Expected:", expected_msg)
|
print("Expected:", expected_msg)
|
||||||
print("Actual:", output)
|
print("Actual:", output)
|
||||||
if isinstance(expected_msg, re.Pattern):
|
# https://stackoverflow.com/a/34178375
|
||||||
|
if isinstance(expected_msg, typing.Pattern):
|
||||||
self.assertRegex(output.args[1], expected_msg)
|
self.assertRegex(output.args[1], expected_msg)
|
||||||
else:
|
else:
|
||||||
self.assertIn(expected_msg, output.args[1])
|
self.assertIn(expected_msg, output.args[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user