Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
4003d379
Commit
4003d379
authored
Jun 13, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promise/plugin: Flake8ize test_check_url_available
parent
d6b6fadb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
slapos/test/promise/plugin/test_check_url_available.py
slapos/test/promise/plugin/test_check_url_available.py
+17
-5
No files found.
slapos/test/promise/plugin/test_check_url_available.py
View file @
4003d379
##############################################################################
#
# Copyright (c) 201
8
Vifib SARL and Contributors. All Rights Reserved.
# Copyright (c) 201
9
Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
...
...
@@ -27,7 +27,8 @@
from
slapos.test.promise.plugin
import
TestPromisePluginMixin
from
slapos.grid.promise
import
PromiseError
import
os
import
unittest
class
TestCheckUrlAvailable
(
TestPromisePluginMixin
):
...
...
@@ -59,7 +60,10 @@ extra_config_dict = {
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL u'https://': No host supplied"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL u'https://': No host supplied"
)
def
test_check_url_malformed
(
self
):
content
=
self
.
base_content
%
{
...
...
@@ -73,7 +77,10 @@ extra_config_dict = {
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL '': No schema supplied. Perhaps you meant http://?"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL '': No schema supplied. Perhaps you meant http://?"
)
def
test_check_url_site_off
(
self
):
content
=
content
=
self
.
base_content
%
{
...
...
@@ -87,7 +94,12 @@ extra_config_dict = {
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR connection not possible while accessing 'https://localhost:56789/site'"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR connection not possible while accessing "
"'https://localhost:56789/site'"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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