mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
[Tests] Replace module import with sys.modules
This commit is contained in:
parent
09c6e0cb5c
commit
b8ab6e4083
1 changed files with 2 additions and 2 deletions
|
@ -1,13 +1,13 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
import deluge.core.torrent
|
import deluge.core.torrent
|
||||||
import deluge.tests.common as common
|
import deluge.tests.common as common
|
||||||
import test_torrent
|
|
||||||
from deluge._libtorrent import lt
|
from deluge._libtorrent import lt
|
||||||
from deluge.core.core import Core
|
from deluge.core.core import Core
|
||||||
from deluge.core.rpcserver import RPCServer
|
from deluge.core.rpcserver import RPCServer
|
||||||
|
@ -41,7 +41,7 @@ class TorrentTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# Save component and set back on teardown
|
# Save component and set back on teardown
|
||||||
self.original_component = deluge.core.torrent.component
|
self.original_component = deluge.core.torrent.component
|
||||||
deluge.core.torrent.component = test_torrent
|
deluge.core.torrent.component = sys.modules[__name__]
|
||||||
self.setup_config()
|
self.setup_config()
|
||||||
global rpcserver
|
global rpcserver
|
||||||
global core
|
global core
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue