From c1d7c9cd7fa60ecfa5a2578e134ee01de9948abc Mon Sep 17 00:00:00 2001 From: Sheng Date: Sun, 22 Apr 2018 20:59:22 +0800 Subject: [PATCH] Added test_get_policy_dictionary --- README.md | 3 ++- tests/test_policy.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/test_policy.py diff --git a/README.md b/README.md index 996f778..73725d3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ A simple web application to be used as an ssh client to connect to your ssh serv git clone https://github.com/huashengdun/webssh.git cd webssh pip install -r requirements.txt -python webssh/main.py +cd webssh +python main.py ``` ### Options diff --git a/tests/test_policy.py b/tests/test_policy.py new file mode 100644 index 0000000..1feee35 --- /dev/null +++ b/tests/test_policy.py @@ -0,0 +1,13 @@ +import unittest +from paramiko.client import RejectPolicy, WarningPolicy +from webssh.policy import AutoAddPolicy, get_policy_dictionary + + +class TestPolicy(unittest.TestCase): + + def test_get_policy_dictionary(self): + classes = [AutoAddPolicy, RejectPolicy, WarningPolicy] + dic = get_policy_dictionary() + for cls in classes: + val = dic[cls.__name__.lower()] + self.assertIs(cls, val)