示例#1
0
    def testWithClientSet(self):
        mock_client = mock.MagicMock()

        with mock.patch.object(magics_impl._state, 'client', mock_client):
            magics_impl.grr_ps_impl()

            mock_client.ps.assert_called_once_with()
示例#2
0
def grr_ps(line: Text) -> pd.DataFrame:
    """Lists processes of the selected client.

  Args:
    line: A string representing arguments passed to the magic command.

  Returns:
    Sequence of processes.

  Raises:
    NoClientSelectedError: Client is not selected to perform this operation.
  """
    del line  # Unused.
    return magics_impl.grr_ps_impl()
示例#3
0
 def testNoClientSelected(self):
     with self.assertRaises(magics_impl.NoClientSelectedError):
         magics_impl.grr_ps_impl()