Commit ffb776ca by Sheng

Use absolute path for importing modules

parent f78588bc
import sys
sys.path.insert(0, 'webssh')
...@@ -29,7 +29,7 @@ from paramiko.py3compat import u, decodebytes ...@@ -29,7 +29,7 @@ from paramiko.py3compat import u, decodebytes
# setup logging # setup logging
paramiko.util.log_to_file('sshserver.log') paramiko.util.log_to_file('tests/sshserver.log')
host_key = paramiko.RSAKey(filename='tests/test_rsa.key') host_key = paramiko.RSAKey(filename='tests/test_rsa.key')
# host_key = paramiko.DSSKey(filename='test_dss.key') # host_key = paramiko.DSSKey(filename='test_dss.key')
......
import json import json
import handler import webssh.handler as handler
import random import random
import threading import threading
import tornado.websocket import tornado.websocket
...@@ -7,8 +7,8 @@ import tornado.gen ...@@ -7,8 +7,8 @@ import tornado.gen
from tornado.testing import AsyncHTTPTestCase from tornado.testing import AsyncHTTPTestCase
from tornado.options import options from tornado.options import options
from main import make_app, make_handlers from webssh.main import make_app, make_handlers
from settings import get_app_settings from webssh.settings import get_app_settings
from tests.sshserver import run_ssh_server from tests.sshserver import run_ssh_server
......
...@@ -3,7 +3,7 @@ import os.path ...@@ -3,7 +3,7 @@ import os.path
import paramiko import paramiko
from tornado.httputil import HTTPServerRequest from tornado.httputil import HTTPServerRequest
from handler import MixinHandler, IndexHandler from webssh.handler import MixinHandler, IndexHandler
class TestMixinHandler(unittest.TestCase): class TestMixinHandler(unittest.TestCase):
......
...@@ -4,8 +4,10 @@ import paramiko ...@@ -4,8 +4,10 @@ import paramiko
from shutil import copyfile from shutil import copyfile
from paramiko.client import RejectPolicy, WarningPolicy from paramiko.client import RejectPolicy, WarningPolicy
from policy import (AutoAddPolicy, get_policy_dictionary, load_host_keys, from webssh.policy import (
get_policy_class, check_policy_setting) AutoAddPolicy, get_policy_dictionary, load_host_keys,
get_policy_class, check_policy_setting
)
class TestPolicy(unittest.TestCase): class TestPolicy(unittest.TestCase):
......
...@@ -3,8 +3,10 @@ import unittest ...@@ -3,8 +3,10 @@ import unittest
import paramiko import paramiko
import tornado.options as options import tornado.options as options
from settings import get_host_keys_settings, get_policy_setting, base_dir from webssh.settings import (
from policy import load_host_keys get_host_keys_settings, get_policy_setting, base_dir
)
from webssh.policy import load_host_keys
class TestSettings(unittest.TestCase): class TestSettings(unittest.TestCase):
......
...@@ -8,7 +8,7 @@ import paramiko ...@@ -8,7 +8,7 @@ import paramiko
import tornado.web import tornado.web
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from worker import Worker, recycle_worker, workers from webssh.worker import Worker, recycle_worker, workers
try: try:
from concurrent.futures import Future from concurrent.futures import Future
......
...@@ -3,8 +3,8 @@ import tornado.web ...@@ -3,8 +3,8 @@ import tornado.web
import tornado.ioloop import tornado.ioloop
from tornado.options import parse_command_line, options from tornado.options import parse_command_line, options
from handler import IndexHandler, WsockHandler from webssh.handler import IndexHandler, WsockHandler
from settings import (get_app_settings, get_host_keys_settings, from webssh.settings import (get_app_settings, get_host_keys_settings,
get_policy_setting) get_policy_setting)
......
...@@ -3,7 +3,9 @@ import os.path ...@@ -3,7 +3,9 @@ import os.path
import uuid import uuid
from tornado.options import define from tornado.options import define
from policy import load_host_keys, get_policy_class, check_policy_setting from webssh.policy import (
load_host_keys, get_policy_class, check_policy_setting
)
define('address', default='127.0.0.1', help='listen address') define('address', default='127.0.0.1', help='listen address')
......
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