From f9e3b83456d8e866208cf36439f36d9001fa22be Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 15 Apr 2016 19:13:12 -0700 Subject: [PATCH] move tests step 2: fix imports, setup.py, tox.ini --- setup.py | 1 - tests/common.py | 2 +- tests/test_blocking.py | 6 +++--- tests/test_interop.py | 2 +- tests/test_scripts.py | 6 +++--- tests/test_server.py | 2 +- tests/test_transit_twisted.py | 2 +- tox.ini | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index 457e0e76..7c52c2ff 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ "wormhole.blocking", "txwormhole", "wormhole_cli", - "wormhole.test", "wormhole_server"], package_data={"wormhole_server": ["db-schemas/*.sql"]}, entry_points={"console_scripts": diff --git a/tests/common.py b/tests/common.py index 933909a5..4a46b37a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -3,7 +3,7 @@ from twisted.python import log from txwormhole.transit import allocate_tcp_port from wormhole_server.server import RelayServer -from .. import __version__ +from wormhole import __version__ class ServerBase: def setUp(self): diff --git a/tests/test_blocking.py b/tests/test_blocking.py index e9306046..b64100c6 100644 --- a/tests/test_blocking.py +++ b/tests/test_blocking.py @@ -3,9 +3,9 @@ from twisted.trial import unittest from twisted.internet.defer import gatherResults, succeed from twisted.internet.threads import deferToThread -from ..blocking.transcribe import (Wormhole, UsageError, ChannelManager, - WrongPasswordError) -from ..blocking.eventsource import EventSourceFollower +from wormhole.blocking.transcribe import (Wormhole, UsageError, ChannelManager, + WrongPasswordError) +from wormhole.blocking.eventsource import EventSourceFollower from .common import ServerBase APPID = u"appid" diff --git a/tests/test_interop.py b/tests/test_interop.py index f216a6e1..ec655afc 100644 --- a/tests/test_interop.py +++ b/tests/test_interop.py @@ -3,7 +3,7 @@ from twisted.internet.defer import gatherResults from twisted.internet.threads import deferToThread from txwormhole.transcribe import Wormhole as twisted_Wormhole -from ..blocking.transcribe import Wormhole as blocking_Wormhole +from wormhole.blocking.transcribe import Wormhole as blocking_Wormhole from .common import ServerBase # make sure the two implementations (Twisted-style and blocking-style) can diff --git a/tests/test_scripts.py b/tests/test_scripts.py index 89bf214e..13a59e61 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -4,12 +4,12 @@ from twisted.python import procutils, log from twisted.internet.utils import getProcessOutputAndValue from twisted.internet.defer import inlineCallbacks -from .. import __version__ +from wormhole import __version__ from .common import ServerBase from wormhole_cli import runner, cmd_send, cmd_receive from wormhole_cli.cmd_send import build_phase1_data -from ..errors import TransferError -from ..timing import DebugTiming +from wormhole.errors import TransferError +from wormhole.timing import DebugTiming class Phase1Data(unittest.TestCase): def test_text(self): diff --git a/tests/test_server.py b/tests/test_server.py index 2c07e819..87a8c8d4 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -8,7 +8,7 @@ from twisted.internet.threads import deferToThread from twisted.internet.endpoints import clientFromString, connectProtocol from twisted.web.client import getPage, Agent, readBody -from .. import __version__ +from wormhole import __version__ from .common import ServerBase from wormhole_server import relay_server, transit_server from txwormhole.eventsource import EventSource diff --git a/tests/test_transit_twisted.py b/tests/test_transit_twisted.py index 2a4e50de..fd42291c 100644 --- a/tests/test_transit_twisted.py +++ b/tests/test_transit_twisted.py @@ -7,7 +7,7 @@ from twisted.python import log, failure from twisted.test import proto_helpers from txwormhole import transit -from ..errors import UsageError +from wormhole.errors import UsageError from nacl.secret import SecretBox from nacl.exceptions import CryptoError diff --git a/tox.ini b/tox.ini index ebef7a79..f84db2da 100644 --- a/tox.ini +++ b/tox.ini @@ -21,9 +21,9 @@ deps = pyflakes {env:EXTRA_DEPENDENCY:} commands = - pyflakes setup.py src + pyflakes setup.py src tests wormhole --version - trial {posargs:wormhole} + trial {posargs:tests} # on windows, trial is installed as venv/bin/trial.py, not .exe, but (at # least appveyor) adds .PY to $PATHEXT. So "trial wormhole" might work on