mirror of https://github.com/huashengdun/webssh
Updated tests
parent
8e31cf5259
commit
e5990f4384
|
@ -0,0 +1,4 @@
|
|||
import sys
|
||||
|
||||
|
||||
sys.path.insert(0, 'webssh')
|
|
@ -0,0 +1 @@
|
|||
192.168.1.199 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwZGQmNFADnAAlm5uFLQTrdxqpNxHdgg4JPbB3sR2kr
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue