Added print_version

This commit is contained in:
Sheng
2018-05-06 18:32:31 +08:00
parent 934d6dfcb6
commit 72df3b9ee9
2 changed files with 17 additions and 1 deletions
+7 -1
View File
@@ -4,13 +4,19 @@ import paramiko
import tornado.options as options
from webssh.settings import (
get_host_keys_settings, get_policy_setting, base_dir
get_host_keys_settings, get_policy_setting, base_dir, print_version
)
from webssh.policy import load_host_keys
from webssh._version import __version__
class TestSettings(unittest.TestCase):
def test_print_version(self):
self.assertNotEqual(print_version(False), 2, msg=__version__)
with self.assertRaises(SystemExit):
self.assertEqual(print_version(True), 2, msg=__version__)
def test_get_host_keys_settings(self):
options.hostFile = ''
options.sysHostFile = ''