Updated tests
This commit is contained in:
@@ -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
|
import paramiko
|
||||||
|
|
||||||
from paramiko.client import RejectPolicy, WarningPolicy
|
from paramiko.client import RejectPolicy, WarningPolicy
|
||||||
from webssh.policy import AutoAddPolicy, get_policy_dictionary, load_host_keys
|
from policy import (AutoAddPolicy, get_policy_dictionary, load_host_keys,
|
||||||
from webssh.policy import get_policy_class, check_policy_setting
|
get_policy_class, check_policy_setting)
|
||||||
|
|
||||||
|
|
||||||
class TestPolicy(unittest.TestCase):
|
class TestPolicy(unittest.TestCase):
|
||||||
@@ -25,6 +25,10 @@ class TestPolicy(unittest.TestCase):
|
|||||||
host_keys = load_host_keys(path)
|
host_keys = load_host_keys(path)
|
||||||
self.assertFalse(host_keys)
|
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):
|
def test_get_policy_class(self):
|
||||||
keys = ['autoadd', 'reject', 'warning']
|
keys = ['autoadd', 'reject', 'warning']
|
||||||
vals = [AutoAddPolicy, RejectPolicy, WarningPolicy]
|
vals = [AutoAddPolicy, RejectPolicy, WarningPolicy]
|
||||||
|
|||||||
Reference in New Issue
Block a user