Commit 88af808d authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend/test: Flake8ize

parent 9e54fb65
...@@ -42,7 +42,6 @@ from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter ...@@ -42,7 +42,6 @@ from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter
import time import time
import tempfile import tempfile
import ipaddress import ipaddress
import importlib
from utils import SlapOSInstanceTestCase from utils import SlapOSInstanceTestCase
from utils import findFreeTCPPort from utils import findFreeTCPPort
...@@ -224,6 +223,7 @@ def getQUIC(url, ip, port): ...@@ -224,6 +223,7 @@ def getQUIC(url, ip, port):
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
return False, e.output return False, e.output
def getPluginParameterDict(software_path, filepath): def getPluginParameterDict(software_path, filepath):
bin_file = os.path.join(software_path, 'bin', 'test-plugin-promise') bin_file = os.path.join(software_path, 'bin', 'test-plugin-promise')
with open(bin_file, 'w') as f: with open(bin_file, 'w') as f:
...@@ -248,6 +248,7 @@ print json.dumps(module.extra_config_dict) ...@@ -248,6 +248,7 @@ print json.dumps(module.extra_config_dict)
except ValueError, e: except ValueError, e:
raise ValueError("%s\nResult was: %s" % (e, result)) raise ValueError("%s\nResult was: %s" % (e, result))
class TestDataMixin(object): class TestDataMixin(object):
@staticmethod @staticmethod
def generateHashFromFiles(file_list): def generateHashFromFiles(file_list):
...@@ -1081,12 +1082,12 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s { ...@@ -1081,12 +1082,12 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
def test_promise_monitor_httpd_listening_on_tcp(self): def test_promise_monitor_httpd_listening_on_tcp(self):
runpromise_bin = os.path.join(self.software_path, 'bin', runpromise_bin = os.path.join(
'monitor.runpromise') self.software_path, 'bin', 'monitor.runpromise')
result = set([ result = set([
subprocess.call([runpromise_bin, '-c', subprocess.call([
os.path.join(os.path.dirname(q), runpromise_bin, '-c',
'../monitor.conf'), os.path.join(os.path.dirname(q), '../monitor.conf'),
'--run-only', '--run-only',
'monitor-httpd-listening-on-tcp.py'] 'monitor-httpd-listening-on-tcp.py']
) for q in glob.glob( ) for q in glob.glob(
...@@ -3407,7 +3408,8 @@ class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -3407,7 +3408,8 @@ class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase,
re6st_connectivity_promise_file = re6st_connectivity_promise_list[0] re6st_connectivity_promise_file = re6st_connectivity_promise_list[0]
self.assertEqual( self.assertEqual(
getPluginParameterDict(self.software_path, re6st_connectivity_promise_file), getPluginParameterDict(
self.software_path, re6st_connectivity_promise_file),
{ {
'url': 'http://[2001:67c:1254:4::1]/index.html', 'url': 'http://[2001:67c:1254:4::1]/index.html',
} }
...@@ -3459,7 +3461,8 @@ class TestRe6stVerificationUrlSlave(SlaveHttpFrontendTestCase, ...@@ -3459,7 +3461,8 @@ class TestRe6stVerificationUrlSlave(SlaveHttpFrontendTestCase,
re6st_connectivity_promise_file = re6st_connectivity_promise_list[0] re6st_connectivity_promise_file = re6st_connectivity_promise_list[0]
self.assertEqual( self.assertEqual(
getPluginParameterDict(self.software_path, re6st_connectivity_promise_file), getPluginParameterDict(
self.software_path, re6st_connectivity_promise_file),
{ {
'url': 'some-re6st-verification-url', 'url': 'some-re6st-verification-url',
} }
......
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