def test_clear_requestor(self): client = self.client with client_ctx(Resources, client): res = Resources() res.clear(provider=False, requestor=True) client.clear_dir.assert_called_with(DirectoryType.RECEIVED)
def test_clear_all(self): client = self.client with client_ctx(Resources, client): res = Resources() res.clear(provider=True, requestor=True) assert len(client.clear_dir.mock_calls) == 1
def test_clear_none(self): client = self.client with client_ctx(Resources, client): res = Resources() with self.assertRaises(CommandException): res.clear(False, False) assert not client.clear_dir.called