def __init__(self, channel, url: str): """Constructor. Don't instantiate this directly, use the subclasses. :param channel: The RPC channel to use. :param url: The URL of the RPC service. """ self.channel = channel self.url = url self.stub = CompilerGymServiceStub(self.channel) self.spaces: GetSpacesReply = self(self.stub.GetSpaces, GetSpacesRequest())
def test_call_stub_negative_timeout(connection: CompilerGymServiceConnection): with pytest.raises(TimeoutError, match=r"Deadline Exceeded \(-10.0 seconds\)"): connection(connection.stub.GetSpaces, GetSpacesRequest(), timeout=-10)
def test_call_stub_negative_timeout(connection: CompilerGymServiceConnection): with pytest.raises(TimeoutError) as ctx: connection(connection.stub.GetSpaces, GetSpacesRequest(), timeout=-10) assert str(ctx.value) == "Deadline Exceeded (-10.0 seconds)"