Esempio n. 1
0
def test_capture_mp_get():
    vision = VisionSubclass(0)
    processor = ProcessorA(vision)
    with MultiProcessing(processor) as mp:
        assert (mp.remote_get('test_remote_get') == 'success')
        assert (mp.test_remote_get == 'success')
        vision.test_remote_get = 'changing current process which will not change remote process'
        assert (mp.test_remote_get == 'success')
Esempio n. 2
0
def test_capture_mp_call():
    vision = VisionSubclass(0)
    processor = ProcessorA(vision)
    with MultiProcessing(processor) as mp:
        assert (mp.remote_call('test_remote_call', 2, 5,
                               kwarg_test=7) == ('success', 2, 5, 7))
        vision.test_remote_get = 1
        vision.test_remote_get = 3
        assert (mp.remote_call('test_remote_call', 2, 5,
                               kwarg_test=7) == ('success', 2, 5, 7))
        assert (mp.test_remote_call(2, 5,
                                    kwarg_test=7) == ('success', 2, 5, 7))
        mp.remote_set('test_remote_get', 2)
        assert (mp.remote_get('test_remote_get') == 2)
        assert (mp.remote_call('test_remote_call', 2, 5,
                               kwarg_test=7) == (2, 2, 5, 7))
        assert (mp.test_remote_call(2, 5, kwarg_test=7) == (2, 2, 5, 7))
        assert (mp.test_payload1(Payload(2, 1)).a == 3)
        assert (mp.test_payload2(Payload(2, 1)).image == 3)
        assert (mp.process(Image(None, 'testing')).image == 'TESTING')