aboutsummaryrefslogtreecommitdiffstats
path: root/local/testing/ExpectationPluginTestCase.py
diff options
context:
space:
mode:
authoralezakos <electrovesta@gmail.com>2020-08-09 16:48:17 +0300
committerGitHub <noreply@github.com>2020-08-09 16:48:17 +0300
commit65c3752b38fa827f816c63a6f864c60f3ea71f86 (patch)
tree6f8b25d28688f885de1b0a788e77358fe1dc67d5 /local/testing/ExpectationPluginTestCase.py
parentb431c5476514784f97985419323cf4bec9a61500 (diff)
parent5a0215deac647f52da3e24dc47057af3b132654e (diff)
downloadsupybot_github-65c3752b38fa827f816c63a6f864c60f3ea71f86.tar.gz
supybot_github-65c3752b38fa827f816c63a6f864c60f3ea71f86.tar.bz2
supybot_github-65c3752b38fa827f816c63a6f864c60f3ea71f86.zip
Merge pull request #27 from blast007/python3
Python 3 support
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