Skip network tests
This commit is contained in:
parent
3c870f6f8c
commit
3e69bac85c
|
@ -159,6 +159,7 @@ class TestCore(unittest.TestCase):
|
|||
self.assertGreaterEqual(
|
||||
len(knownnodes.knownNodes[1]), len(knownnodes.DEFAULT_NODES))
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
def test_0_cleaner(self):
|
||||
"""test knownnodes starvation leading to IndexError in Asyncore"""
|
||||
self._outdate_knownnodes()
|
||||
|
@ -227,11 +228,13 @@ class TestCore(unittest.TestCase):
|
|||
self.fail(
|
||||
'Bootstrap server in knownnodes: %s' % peer.host)
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
def test_dontconnect(self):
|
||||
"""all connections are closed 5 seconds after setting dontconnect"""
|
||||
self._initiate_bootstrap()
|
||||
self.assertEqual(len(BMConnectionPool().connections()), 0)
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
def test_connection(self):
|
||||
"""test connection to bootstrap servers"""
|
||||
self._initiate_bootstrap()
|
||||
|
@ -247,6 +250,7 @@ class TestCore(unittest.TestCase):
|
|||
knownnodes.addKnownNode(1, Peer(addr, port))
|
||||
self._check_connection(True)
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
def test_bootstrap(self):
|
||||
"""test bootstrapping"""
|
||||
BMConfigParser().set('bitmessagesettings', 'socksproxytype', 'none')
|
||||
|
@ -258,6 +262,7 @@ class TestCore(unittest.TestCase):
|
|||
with knownnodes.knownNodesLock:
|
||||
shutil.copyfile(knownnodes_file, knownnodes_file + '.bak')
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
@unittest.skipIf(tor_port_free, 'no running tor detected')
|
||||
def test_bootstrap_tor(self):
|
||||
"""test bootstrapping with tor"""
|
||||
|
@ -266,6 +271,7 @@ class TestCore(unittest.TestCase):
|
|||
self._check_connection()
|
||||
self._check_knownnodes()
|
||||
|
||||
@unittest.skipUnless(state.enableNetwork, 'skip network test')
|
||||
@unittest.skipIf(tor_port_free, 'no running tor detected')
|
||||
def test_onionservicesonly(self):
|
||||
"""ensure bitmessage doesn't try to connect to non-onion nodes
|
||||
|
|
Reference in New Issue
Block a user