Пример #1
0
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([])
Пример #2
0
 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)
Пример #3
0
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([])
Пример #4
0
 def setUp(self):
   super(TestWatchmanClient, self).setUp()
   self.swc = StreamableWatchmanClient(sockpath='/tmp/testing', transport='local')
Пример #5
0
 def setUp(self):
     super().setUp()
     self.swc = StreamableWatchmanClient(sockpath="/tmp/testing", transport="local")
Пример #6
0
 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)
Пример #7
0
 def setUp(self):
   BaseTest.setUp(self)
   self.swc = StreamableWatchmanClient(sockpath='/tmp/testing', transport='local')