Exemple #1
0
def test_client_capture_now():
    with patch('compoundpi.client.CompoundPiServerList.transact') as l, \
            patch('compoundpi.client.CompoundPiDownloadServer'):
        l.return_value = {
            compoundpi.client.IPv4Address('192.168.0.1'): None,
            compoundpi.client.IPv4Address('192.168.0.2'): None,
        }
        client = compoundpi.client.CompoundPiClient()
        client.capture()
        l.assert_called_once_with('CAPTURE 1,0,,', None)
def test_client_capture_now():
    with patch('compoundpi.client.CompoundPiServerList.transact') as l, \
            patch('compoundpi.client.CompoundPiDownloadServer'):
        l.return_value = {
            compoundpi.client.IPv4Address('192.168.0.1'): None,
            compoundpi.client.IPv4Address('192.168.0.2'): None,
            }
        client = compoundpi.client.CompoundPiClient()
        client.capture()
        l.assert_called_once_with('CAPTURE 1,0,,', None)
Exemple #3
0
def test_client_capture_sync():
    with patch('compoundpi.client.CompoundPiServerList.transact') as l, \
            patch('compoundpi.client.time.time', return_value=1000.0), \
            patch('compoundpi.client.CompoundPiDownloadServer'):
        l.return_value = {
            compoundpi.client.IPv4Address('192.168.0.1'): None,
            compoundpi.client.IPv4Address('192.168.0.2'): None,
        }
        client = compoundpi.client.CompoundPiClient()
        client.capture(5, video_port=True, delay=2)
        l.assert_called_once_with('CAPTURE 5,1,,1002.0', None)
def test_client_capture_sync():
    with patch('compoundpi.client.CompoundPiServerList.transact') as l, \
            patch('compoundpi.client.time.time', return_value=1000.0), \
            patch('compoundpi.client.CompoundPiDownloadServer'):
        l.return_value = {
            compoundpi.client.IPv4Address('192.168.0.1'): None,
            compoundpi.client.IPv4Address('192.168.0.2'): None,
            }
        client = compoundpi.client.CompoundPiClient()
        client.capture(5, video_port=True, delay=2)
        l.assert_called_once_with('CAPTURE 5,1,,1002.0', None)