aboutsummaryrefslogtreecommitdiffstats
path: root/local/testing/ExpectationPluginTestCase.py
diff options
context:
space:
mode:
authorScott Wichser <blast007@users.sourceforge.net>2019-01-23 22:38:51 +0000
committerScott Wichser <blast007@users.sourceforge.net>2019-01-23 22:38:51 +0000
commitd85f5f6e634b80416e0cee1c80377978c6f9f6c1 (patch)
treef19e0e6ac524f31b941c7ad30b2347cb8deba532 /local/testing/ExpectationPluginTestCase.py
parentb431c5476514784f97985419323cf4bec9a61500 (diff)
downloadsupybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.tar.gz
supybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.tar.bz2
supybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.zip
Through the use of 2to3 and some manual fixes, the plugin loads successfully on Python 3.
Diffstat (limited to 'local/testing/ExpectationPluginTestCase.py')
-rw-r--r--local/testing/ExpectationPluginTestCase.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/local/testing/ExpectationPluginTestCase.py b/local/testing/ExpectationPluginTestCase.py
index 507fd87..17dd1eb 100644
--- a/local/testing/ExpectationPluginTestCase.py
+++ b/local/testing/ExpectationPluginTestCase.py
@@ -9,7 +9,7 @@ from sys import stdout
from time import sleep
import re
-import urllib
+import urllib.request, urllib.parse, urllib.error
class ExpectationPluginTestCase(PluginTestCase):
plugins = {}
@@ -18,10 +18,10 @@ class ExpectationPluginTestCase(PluginTestCase):
m = self._feedMsg('get ' + query)
manyEs = tcolors.FAIL + 'E' * len(args) + tcolors.ENDC
if m is None:
- print manyEs
- raise TimeoutError, query
+ print(manyEs)
+ raise TimeoutError(query)
if m.args[1].startswith('Error:'):
- print manyEs
+ print(manyEs)
self.fail('%r errored: %s' % (query, m.args[1]))
errors = []
@@ -37,10 +37,10 @@ class ExpectationPluginTestCase(PluginTestCase):
stdout.flush()
if errors:
- print "\n%sWhile describing %s" % (tcolors.FAIL, query)
+ print("\n%sWhile describing %s" % (tcolors.FAIL, query))
for error in errors:
- print "- Failed to assert that %s" % (error,)
- print tcolors.ENDC
+ print("- Failed to assert that %s" % (error,))
+ print(tcolors.ENDC)
self.fail("%i assertions failed while describing %s" % (len(errors), query))
def sendRequest(self, file):
@@ -52,7 +52,7 @@ class ExpectationPluginTestCase(PluginTestCase):
with open('samples/' + file + '.json', 'r') as content_file:
content = content_file.read()
self.files[file] = content
- urllib.urlopen('http://localhost:' + str(self.port), 'payload=' + content)
+ urllib.request.urlopen('http://localhost:' + str(self.port), 'payload=' + content)
def conf(self, name, value):
"""Sets one of the plugin's configuration values"""

© 2014-2024 Faster IT GmbH | imprint | privacy policy