Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos
Commits
88af808d
Commit
88af808d
authored
Feb 28, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend/test: Flake8ize
parent
9e54fb65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+11
-8
No files found.
software/caddy-frontend/test/test.py
View file @
88af808d
...
@@ -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
\
n
Result was: %s"
%
(
e
,
result
))
raise
ValueError
(
"%s
\
n
Result 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
:
67
c
:
1254
:
4
::
1
]
/
index
.
html
',
'
url
': '
http
:
//
[
2001
:
67
c
:
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
',
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment