Move all tests data into a separate directory

This commit is contained in:
Sheng
2018-08-24 15:11:21 +08:00
parent 74cdb2d31f
commit 757702127a
14 changed files with 29 additions and 26 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ import unittest
import paramiko
import tornado.options as options
from tests.utils import make_tests_data_path
from webssh.policy import load_host_keys
from webssh.settings import (
get_host_keys_settings, get_policy_setting, base_dir, print_version
@@ -30,8 +31,8 @@ class TestSettings(unittest.TestCase):
load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
)
options.hostFile = os.path.join(base_dir, 'tests', 'known_hosts_example') # noqa
options.sysHostFile = os.path.join(base_dir, 'tests', 'known_hosts_example2') # noqa
options.hostFile = make_tests_data_path('known_hosts_example')
options.sysHostFile = make_tests_data_path('known_hosts_example2')
dic2 = get_host_keys_settings(options)
self.assertEqual(dic2['host_keys'], load_host_keys(options.hostFile))
self.assertEqual(dic2['host_keys_filename'], options.hostFile)