Commit d71fc3b2 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent 2b6466c0
......@@ -68,17 +68,12 @@ extra_config_dict = {
self.launcher.run()
result = self.getPromiseResult(self.promise_name)
self.assertEqual(result['result']['failed'], True)
if six.PY3:
self.assertEqual(
result['result']['message'],
"ERROR IsADirectoryError(21, 'Is a directory') "
"during opening and reading file %r" % (filename,)
)
else:
self.assertEqual(
result['result']['message'],
"ERROR IOError(21, 'Is a directory') "
"during opening and reading file %r" % (filename,)
"ERROR %s(21, 'Is a directory') "
"during opening and reading file %r" % (
"IsADirectoryError" if six.PY3 else "IOError",
filename)
)
def test_check_file_not_exists(self):
......@@ -94,17 +89,12 @@ extra_config_dict = {
self.launcher.run()
result = self.getPromiseResult(self.promise_name)
self.assertEqual(result['result']['failed'], True)
if six.PY3:
self.assertEqual(
result['result']['message'],
"ERROR FileNotFoundError(2, 'No such file or directory') "
"during opening and reading file %r" % (filename,)
)
else:
self.assertEqual(
result['result']['message'],
"ERROR IOError(2, 'No such file or directory') "
"during opening and reading file %r" % (filename,)
"ERROR %s(2, 'No such file or directory') "
"during opening and reading file %r" % (
"FileNotFoundError" if six.PY3 else "IOError",
filename)
)
def test_check_file_empty(self):
......
......@@ -275,15 +275,10 @@ class TestCheckUrlAvailable(CheckUrlAvailableMixin):
self.launcher.run()
result = self.getPromiseResult(self.promise_name)
self.assertEqual(result['result']['failed'], True)
if six.PY3:
self.assertEqual(
result['result']['message'],
"ERROR: Invalid URL 'https://': No host supplied"
)
else:
self.assertEqual(
result['result']['message'],
"ERROR: Invalid URL u'https://': No host supplied"
"ERROR: Invalid URL %s'https://': No host supplied" %
('' if six.PY3 else 'u')
)
def test_check_url_malformed(self):
......
......@@ -159,8 +159,8 @@ class TestAutoSTemp(unittest.TestCase):
removes it when deleted.
"""
f = AutoSTemp("foo")
with open(f.name, "r") as file:
self.assertEqual(file.read(), "foo")
with open(f.name, "r") as f_:
self.assertEqual(f_.read(), "foo")
fname = f.name
self.assertTrue(os.path.isfile(fname))
del f
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment