Closed edavalosanaya closed 1 year ago
Update: created a new virtual environment and reinstall the package. Now I have 2/6 tests passing:
================================================================================================================================ test session starts =================================================================================================================================
platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/eduardo/GitHub/g3pylib, configfile: pyproject.toml
plugins: dotenv-0.5.2, asyncio-0.19.0
asyncio: mode=auto
collected 6 items
tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_ip
----------------------------------------------------------------------------------------------------------------------------------- live log setup -----------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:23 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [ INFO] Attempting connection to websocket ws://192.168.75.51/websocket, RTSP rtsp://192.168.75.51:8554/live/all and HTTP http://192.168.75.51:80 (__init__.py:301)
2022-09-27 07:41:23 [ DEBUG] = connection is CONNECTING (protocol.py:253)
2022-09-27 07:41:23 [ DEBUG] > GET /websocket HTTP/1.1 (client.py:111)
2022-09-27 07:41:23 [ DEBUG] > Host: 192.168.75.51 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Upgrade: websocket (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Connection: Upgrade (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Key: LsclESXGmIqY+3PiK2mHMg== (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Version: 13 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Protocol: g3api (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > User-Agent: Python/3.10 websockets/10.3 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] < HTTP/1.1 101 Switching Protocols (client.py:144)
2022-09-27 07:41:23 [ DEBUG] < Server: Servd (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Date: Tue, 27 Sep 2022 13:38:16 GMT (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Access-Control-Allow-Origin: * (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Upgrade: websocket (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Connection: Upgrade (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Sec-WebSocket-Accept: tPxz5vhKgYE5BJpNb+BSEBPtPQ8= (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Sec-WebSocket-Protocol: g3api (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Content-Length: 0 (client.py:146)
2022-09-27 07:41:23 [ DEBUG] = connection is OPEN (protocol.py:342)
2022-09-27 07:41:23 [ DEBUG] Receiver task starting (__init__.py:224)
2022-09-27 07:41:23 [ DEBUG] > TEXT '{"path": "/system.recording-unit-serial", "method": "GET", "id": 1}' [67 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [ DEBUG] < TEXT '{"id":1,"body":"TG03B-080201035331"}' [36 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [ DEBUG] Received {'id': 1, 'body': 'TG03B-080201035331'} (__init__.py:196)
2022-09-27 07:41:23 [ DEBUG] receiver task cancelled (__init__.py:286)
2022-09-27 07:41:23 [ DEBUG] = connection is CLOSING (protocol.py:1207)
2022-09-27 07:41:23 [ DEBUG] > CLOSE 1000 (OK) [2 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [ DEBUG] < CLOSE 1000 (OK) [2 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [ DEBUG] = connection is CLOSED (protocol.py:1489)
PASSED [ 16%]
tests/test_connect_to_glasses.py::test_connect_with_service_using_ip
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [ INFO] Attempting connection to websocket ws://192.168.75.51/websocket, RTSP rtsp://192.168.75.51:8554/live/all and HTTP http://192.168.75.51:80 (__init__.py:301)
2022-09-27 07:41:23 [ DEBUG] = connection is CONNECTING (protocol.py:253)
2022-09-27 07:41:23 [ DEBUG] > GET /websocket HTTP/1.1 (client.py:111)
2022-09-27 07:41:23 [ DEBUG] > Host: 192.168.75.51 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Upgrade: websocket (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Connection: Upgrade (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Key: 89gP7iBzvKZYRaRELr2QAQ== (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Version: 13 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > Sec-WebSocket-Protocol: g3api (client.py:113)
2022-09-27 07:41:23 [ DEBUG] > User-Agent: Python/3.10 websockets/10.3 (client.py:113)
2022-09-27 07:41:23 [ DEBUG] < HTTP/1.1 101 Switching Protocols (client.py:144)
2022-09-27 07:41:23 [ DEBUG] < Server: Servd (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Date: Tue, 27 Sep 2022 13:38:16 GMT (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Access-Control-Allow-Origin: * (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Upgrade: websocket (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Connection: Upgrade (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Sec-WebSocket-Accept: K09OjVF/ehZk5LyRf+0cekfoJ3Y= (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Sec-WebSocket-Protocol: g3api (client.py:146)
2022-09-27 07:41:23 [ DEBUG] < Content-Length: 0 (client.py:146)
2022-09-27 07:41:23 [ DEBUG] = connection is OPEN (protocol.py:342)
2022-09-27 07:41:23 [ DEBUG] Receiver task starting (__init__.py:224)
2022-09-27 07:41:23 [ DEBUG] > TEXT '{"path": "/system.recording-unit-serial", "method": "GET", "id": 1}' [67 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [ DEBUG] < TEXT '{"id":1,"body":"TG03B-080201035331"}' [36 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [ DEBUG] Received {'id': 1, 'body': 'TG03B-080201035331'} (__init__.py:196)
2022-09-27 07:41:23 [ DEBUG] receiver task cancelled (__init__.py:286)
2022-09-27 07:41:23 [ DEBUG] = connection is CLOSING (protocol.py:1207)
2022-09-27 07:41:23 [ DEBUG] > CLOSE 1000 (OK) [2 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [ DEBUG] < CLOSE 1000 (OK) [2 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [ DEBUG] = connection is CLOSED (protocol.py:1489)
PASSED [ 33%]
tests/test_connect_to_glasses.py::test_connect_with_service_using_hostname
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [ INFO] Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80 (__init__.py:301)
FAILED [ 50%]
tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_hostname
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [ INFO] Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80 (__init__.py:301)
FAILED [ 66%]
tests/test_connect_to_glasses.py::test_connect_with_hostname_no_zeroconf
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [ INFO] Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80 (__init__.py:301)
FAILED [ 83%]
tests/test_connect_to_glasses.py::test_connect_with_urls
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [ INFO] Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80 (__init__.py:301)
FAILED [100%]
--------------------------------------------------------------------------------------------------------------------------------- live log teardown ----------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [ DEBUG] Using selector: EpollSelector (selector_events.py:54)
====================================================================================================================================== FAILURES ======================================================================================================================================
______________________________________________________________________________________________________________________ test_connect_with_service_using_hostname ______________________________________________________________________________________________________________________
g3_hostname = 'tg03b-080201035331'
async def test_connect_with_service_using_hostname(g3_hostname: str):
g3_service = await G3ServiceDiscovery.request_service(g3_hostname)
> async with connect_to_glasses.with_service(g3_service, using_ip=False) as g3:
tests/test_connect_to_glasses.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0
def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
"""Resolve host and port into list of address info entries.
Translate the host/port argument into a sequence of 5-tuples that contain
all the necessary arguments for creating a socket connected to that service.
host is a domain name, a string representation of an IPv4/v6 address or
None. port is a string service name such as 'http', a numeric port number or
None. By passing None as the value of host and port, you can pass NULL to
the underlying C API.
The family, type and proto arguments can be optionally specified in order to
narrow the list of addresses returned. Passing zero as a value for each of
these arguments selects the full range of results.
"""
# We override this function since we want to translate the numeric family
# and socket type values to enum constants.
addrlist = []
> for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E socket.gaierror: [Errno -3] Temporary failure in name resolution
../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO g3pylib:__init__.py:301 Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80
_______________________________________________________________________________________________________________ test_connect_with_hostname_using_zeroconf_and_hostname _______________________________________________________________________________________________________________
g3_hostname = 'tg03b-080201035331'
async def test_connect_with_hostname_using_zeroconf_and_hostname(g3_hostname: str):
> async with connect_to_glasses.with_hostname(
g3_hostname, using_zeroconf=True, using_ip=False
) as g3:
tests/test_connect_to_glasses.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0
def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
"""Resolve host and port into list of address info entries.
Translate the host/port argument into a sequence of 5-tuples that contain
all the necessary arguments for creating a socket connected to that service.
host is a domain name, a string representation of an IPv4/v6 address or
None. port is a string service name such as 'http', a numeric port number or
None. By passing None as the value of host and port, you can pass NULL to
the underlying C API.
The family, type and proto arguments can be optionally specified in order to
narrow the list of addresses returned. Passing zero as a value for each of
these arguments selects the full range of results.
"""
# We override this function since we want to translate the numeric family
# and socket type values to enum constants.
addrlist = []
> for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E socket.gaierror: [Errno -3] Temporary failure in name resolution
../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO g3pylib:__init__.py:301 Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80
_______________________________________________________________________________________________________________________ test_connect_with_hostname_no_zeroconf _______________________________________________________________________________________________________________________
g3_hostname = 'tg03b-080201035331'
async def test_connect_with_hostname_no_zeroconf(g3_hostname: str):
> async with connect_to_glasses.with_hostname(
g3_hostname, using_zeroconf=False
) as g3:
tests/test_connect_to_glasses.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0
def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
"""Resolve host and port into list of address info entries.
Translate the host/port argument into a sequence of 5-tuples that contain
all the necessary arguments for creating a socket connected to that service.
host is a domain name, a string representation of an IPv4/v6 address or
None. port is a string service name such as 'http', a numeric port number or
None. By passing None as the value of host and port, you can pass NULL to
the underlying C API.
The family, type and proto arguments can be optionally specified in order to
narrow the list of addresses returned. Passing zero as a value for each of
these arguments selects the full range of results.
"""
# We override this function since we want to translate the numeric family
# and socket type values to enum constants.
addrlist = []
> for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E socket.gaierror: [Errno -3] Temporary failure in name resolution
../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO g3pylib:__init__.py:301 Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80
_______________________________________________________________________________________________________________________________ test_connect_with_urls _______________________________________________________________________________________________________________________________
g3_hostname = 'tg03b-080201035331'
async def test_connect_with_urls(g3_hostname: str):
> async with connect_to_glasses.with_url(
f"ws://{g3_hostname}{DEFAULT_WEBSOCKET_PATH}",
f"rtsp://{g3_hostname}:{DEFAULT_RTSP_PORT}{DEFAULT_RTSP_LIVE_PATH}",
f"http://{g3_hostname}:{DEFAULT_HTTP_PORT}",
) as g3:
tests/test_connect_to_glasses.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0
def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
"""Resolve host and port into list of address info entries.
Translate the host/port argument into a sequence of 5-tuples that contain
all the necessary arguments for creating a socket connected to that service.
host is a domain name, a string representation of an IPv4/v6 address or
None. port is a string service name such as 'http', a numeric port number or
None. By passing None as the value of host and port, you can pass NULL to
the underlying C API.
The family, type and proto arguments can be optionally specified in order to
narrow the list of addresses returned. Passing zero as a value for each of
these arguments selects the full range of results.
"""
# We override this function since we want to translate the numeric family
# and socket type values to enum constants.
addrlist = []
> for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E socket.gaierror: [Errno -3] Temporary failure in name resolution
../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO g3pylib:__init__.py:301 Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80
------------------------------------------------------------------------------------------------------------------------------- Captured log teardown --------------------------------------------------------------------------------------------------------------------------------
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector
============================================================================================================================== short test summary info ===============================================================================================================================
FAILED tests/test_connect_to_glasses.py::test_connect_with_service_using_hostname - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_hostname - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_hostname_no_zeroconf - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_urls - socket.gaierror: [Errno -3] Temporary failure in name resolution
============================================================================================================================ 4 failed, 2 passed in 0.38s =============================================================================================================================
[Process exited 1]
In your network, does it work to ping the glasses using the serial number: ping tg03b-080201035331 Or ping tg03b-080201035331.local
What is you computer and network setup? The logs say that you are running on linux and it seems you are connected to the G3 access point via wifi to the glasses? Is the python environment running inside any docker container or any other virtualization environement? Things you can try:
Apologies for the delay, life got busy.
I created a PR #84 with some code changes to help solve this issue.
Closed by PR #86
Hello!
I am trying to develop my own application using the Python client for Tobii Glasses 3. After following the installation instructions shown here, I ran the test suite and had all failing tests. To reduce the print dump, I am only showing the output
test_connect_to_glasses.py
:I assume that the issue is setting up the
.env
file, here is my file:I looked up my network configurations and scanned my network for hostnames and got the following response:
I noticed that the hostname for the Tobii Glasses 3 was
_gateway
so I tried using that as the hostname, but I still had the same issue. Not sure how to proceed. Let me know how I can help.Best, Eduardo Davalos