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
e5990f43
Commit
e5990f43
authored
Apr 23, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests
parent
8e31cf52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
__init__.py
tests/__init__.py
+4
-0
known_hosts_example
tests/known_hosts_example
+1
-0
test_policy.py
tests/test_policy.py
+6
-2
No files found.
tests/__init__.py
View file @
e5990f43
import
sys
sys
.
path
.
insert
(
0
,
'webssh'
)
tests/known_hosts_example
0 → 100644
View file @
e5990f43
192.168.1.199 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwZGQmNFADnAAlm5uFLQTrdxqpNxHdgg4JPbB3sR2kr
tests/test_policy.py
View file @
e5990f43
...
...
@@ -3,8 +3,8 @@ import unittest
import
paramiko
from
paramiko.client
import
RejectPolicy
,
WarningPolicy
from
webssh.policy
import
AutoAddPolicy
,
get_policy_dictionary
,
load_host_keys
from
webssh.policy
import
get_policy_class
,
check_policy_setting
from
policy
import
(
AutoAddPolicy
,
get_policy_dictionary
,
load_host_keys
,
get_policy_class
,
check_policy_setting
)
class
TestPolicy
(
unittest
.
TestCase
):
...
...
@@ -25,6 +25,10 @@ class TestPolicy(unittest.TestCase):
host_keys
=
load_host_keys
(
path
)
self
.
assertFalse
(
host_keys
)
path
=
'tests/known_hosts_example'
host_keys
=
load_host_keys
(
path
)
self
.
assertEqual
(
host_keys
,
paramiko
.
hostkeys
.
HostKeys
(
path
))
def
test_get_policy_class
(
self
):
keys
=
[
'autoadd'
,
'reject'
,
'warning'
]
vals
=
[
AutoAddPolicy
,
RejectPolicy
,
WarningPolicy
]
...
...
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