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()
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()
def testNoClientSelected(self): with self.assertRaises(magics_impl.NoClientSelectedError): magics_impl.grr_ps_impl()