32 lines
749 B
Python
Executable File
32 lines
749 B
Python
Executable File
import unittest
|
|
import process
|
|
|
|
class Mock_Multiprocessing():
|
|
def __init__(self, *args, **kwargs) :
|
|
self.args = args
|
|
self.kwargs = kwargs
|
|
|
|
def get_target(self) :
|
|
return None
|
|
|
|
class Mock_Alert_Config() :
|
|
def __init__(self, id) :
|
|
self.id = id
|
|
|
|
class Test_Process(unittest.TestCase):
|
|
def setUp(self) :
|
|
self.was = process.multiprocessing.Process
|
|
process.multiprocessing.Process = Mock_Multiprocessing
|
|
|
|
def tearDown(self) :
|
|
process.multiprocessing.Process = self.was
|
|
|
|
def test(self) :
|
|
class MockProcess(process.Process) :
|
|
def get_target(self) :
|
|
return None
|
|
p = MockProcess(Mock_Alert_Config("a"), {}, None, True)
|
|
|
|
if __name__ == "__main__" :
|
|
unittest.main()
|