mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
[ConsoleUI] remove deferred
being returned after command
A `return` statement was added in ece31cf
for unit testing to work but
this resulted in Deferred printed in console output.
Added a test_start entry point to return the required deferreds while
removing the return from original start entrypoint.
Closes: https://dev.deluge-torrent.org/ticket/3582
Closes: https://github.com/deluge-torrent/deluge/pull/408
This commit is contained in:
parent
c4b9cc7292
commit
4de754328f
2 changed files with 9 additions and 1 deletions
|
@ -416,7 +416,7 @@ class TestConsoleScriptEntryWithDaemon(BaseTestCase, ConsoleUIWithDaemonBaseTest
|
||||||
def set_var(self, request):
|
def set_var(self, request):
|
||||||
request.cls.var = {
|
request.cls.var = {
|
||||||
'cmd_name': 'deluge-console',
|
'cmd_name': 'deluge-console',
|
||||||
'start_cmd': deluge.ui.console.start,
|
'start_cmd': deluge.ui.console.test_start,
|
||||||
'sys_arg_cmd': ['./deluge-console'],
|
'sys_arg_cmd': ['./deluge-console'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,13 @@ UI_PATH = __path__[0]
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
|
Console().start()
|
||||||
|
|
||||||
|
|
||||||
|
def test_start():
|
||||||
|
"""Entry point for tests
|
||||||
|
|
||||||
|
A workaround for unit tests which require a deferred object to be
|
||||||
|
returned to run properly due to mocking the Twisted reactor.
|
||||||
|
"""
|
||||||
return Console().start()
|
return Console().start()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue