示例#1
0
    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)
示例#2
0
    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
示例#3
0
    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