A test case for core (which will be ran in main thread)
This commit is contained in:
parent
51df0507e2
commit
a3300ba8f1
|
@ -367,7 +367,15 @@ class Main:
|
||||||
time.time() - state.last_api_response >= 30):
|
time.time() - state.last_api_response >= 30):
|
||||||
self.stop()
|
self.stop()
|
||||||
elif not state.enableGUI:
|
elif not state.enableGUI:
|
||||||
|
from tests import core
|
||||||
|
test_core_result = core.run()
|
||||||
|
state.enableGUI = True
|
||||||
self.stop()
|
self.stop()
|
||||||
|
sys.exit(
|
||||||
|
'Core tests failed!'
|
||||||
|
if test_core_result.errors or test_core_result.failures
|
||||||
|
else 0
|
||||||
|
)
|
||||||
|
|
||||||
def daemonize(self):
|
def daemonize(self):
|
||||||
grandfatherPid = os.getpid()
|
grandfatherPid = os.getpid()
|
||||||
|
|
12
src/tests/core.py
Normal file
12
src/tests/core.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
|
class TestCore(unittest.TestCase):
|
||||||
|
"""Test case, which runs from main pybitmessage thread"""
|
||||||
|
def test_pass(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestCore)
|
||||||
|
return unittest.TextTestRunner(verbosity=2).run(suite)
|
Loading…
Reference in New Issue
Block a user