Ejemplo n.º 1
0
    def testCommitNew(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Delete.return_value = filter_pb2.MatcherDeleteResponse()
        getStubMock.return_value = stubMock

        matcher = opencue.wrappers.filter.Matcher()
        with self.assertRaises(Exception):
            matcher.commit()
Ejemplo n.º 2
0
    def testDelete(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Delete.return_value = filter_pb2.MatcherDeleteResponse()
        getStubMock.return_value = stubMock

        matcher = opencue.wrappers.filter.Matcher(
            filter_pb2.Matcher(id=TEST_MATCHER_ID))
        matcher.delete()

        stubMock.Delete.assert_called_with(
            filter_pb2.MatcherDeleteRequest(matcher=matcher.data), timeout=mock.ANY)