class TestWatchmanClient(TestBase): def setUp(self): super(TestWatchmanClient, self).setUp() self.swc = StreamableWatchmanClient(sockpath='/tmp/testing', transport='local') @contextmanager def setup_stream_query(self): with mock.patch.object(StreamableWatchmanClient, '_connect') as mock_connect, \ mock.patch.object(StreamableWatchmanClient, 'sendConn') as mock_sendconn, \ mock.patch.object(StreamableWatchmanClient, 'recvConn') as mock_recvconn: yield mock_connect, mock_sendconn, mock_recvconn def test_stream_query(self): with self.setup_stream_query(): self.swc.stream_query([])
def _make_client(self): """Create a new watchman client using the BSER protocol over a UNIX socket.""" self._logger.debug('setting initial watchman timeout to %s', self._startup_timeout) return StreamableWatchmanClient(sockpath=self.socket, transport='local', timeout=self._startup_timeout)
class TestWatchmanClient(TestBase): def setUp(self): super().setUp() self.swc = StreamableWatchmanClient(sockpath="/tmp/testing", transport="local") @contextmanager def setup_stream_query(self): with unittest.mock.patch.object( StreamableWatchmanClient, "_connect" ) as mock_connect, unittest.mock.patch.object( StreamableWatchmanClient, "sendConn" ) as mock_sendconn, unittest.mock.patch.object( StreamableWatchmanClient, "recvConn" ) as mock_recvconn: yield mock_connect, mock_sendconn, mock_recvconn def test_stream_query(self): with self.setup_stream_query(): self.swc.stream_query([])
def setUp(self): super(TestWatchmanClient, self).setUp() self.swc = StreamableWatchmanClient(sockpath='/tmp/testing', transport='local')
def setUp(self): super().setUp() self.swc = StreamableWatchmanClient(sockpath="/tmp/testing", transport="local")
def _make_client(self, timeout=SOCKET_TIMEOUT_SECONDS): """Create a new watchman client using the BSER protocol over a UNIX socket.""" return StreamableWatchmanClient(sockpath=self.socket, transport='local', timeout=timeout)
def setUp(self): BaseTest.setUp(self) self.swc = StreamableWatchmanClient(sockpath='/tmp/testing', transport='local')