Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
90e7ea03
Commit
90e7ea03
authored
Oct 03, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test_print_version
parent
fdcf1718
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
test_settings.py
tests/test_settings.py
+13
-2
No files found.
tests/test_settings.py
View file @
90e7ea03
import
io
import
sys
import
os.path
import
unittest
import
paramiko
...
...
@@ -8,15 +10,24 @@ from webssh.policy import load_host_keys
from
webssh.settings
import
(
get_host_keys_settings
,
get_policy_setting
,
base_dir
,
print_version
)
from
webssh.utils
import
UnicodeType
from
webssh._version
import
__version__
class
TestSettings
(
unittest
.
TestCase
):
def
test_print_version
(
self
):
self
.
assertNotEqual
(
print_version
(
False
),
2
,
msg
=
__version__
)
sys_stdout
=
sys
.
stdout
sys
.
stdout
=
io
.
StringIO
()
if
UnicodeType
==
str
else
io
.
BytesIO
()
self
.
assertEqual
(
print_version
(
False
),
None
)
self
.
assertEqual
(
sys
.
stdout
.
getvalue
(),
''
)
with
self
.
assertRaises
(
SystemExit
):
self
.
assertEqual
(
print_version
(
True
),
2
,
msg
=
__version__
)
self
.
assertEqual
(
print_version
(
True
),
None
)
self
.
assertEqual
(
sys
.
stdout
.
getvalue
(),
__version__
+
'
\n
'
)
sys
.
stdout
=
sys_stdout
def
test_get_host_keys_settings
(
self
):
options
.
hostFile
=
''
...
...
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