コード例 #1
0
ファイル: client.py プロジェクト: KhaimovMR/flashfocus
def client_request_flash():
    """Request that the server flashes the current window."""
    logging.info("Connecting to the flashfocus daemon...")
    sock = init_client_socket()
    logging.info("Connection established, sending flash request...")
    # Just send a single byte to the server. Contents are unimportant.
    sock.sendall(bytearray("1", encoding="UTF-8"))
コード例 #2
0
ファイル: conftest.py プロジェクト: KhaimovMR/flashfocus
def client_socket(server_socket):
    """Client socket instance."""
    return init_client_socket()
コード例 #3
0
def test_init_client_socket_without_server():
    with raises(SystemExit) as error:
        init_client_socket()
    assert "Error:" in str(error.value)