Commit e5990f43 by Sheng

Updated tests

parent 8e31cf52
import sys
sys.path.insert(0, 'webssh')
192.168.1.199 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINwZGQmNFADnAAlm5uFLQTrdxqpNxHdgg4JPbB3sR2kr
...@@ -3,8 +3,8 @@ import unittest ...@@ -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): ...@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment