Added test_get_policy_dictionary

pull/12/merge
Sheng 2018-04-22 20:59:22 +08:00
parent 452a62814e
commit c1d7c9cd7f
2 changed files with 15 additions and 1 deletions

View File

@ -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

13
tests/test_policy.py Normal file
View File

@ -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)