def commit(self): if self.isNew(): raise Exception( "unable to commit matcher that has not been created, proxy does not exist" ) self.data.input = self.data.input.replace(" ", "") self.stub.Commit(filter_pb2.MatcherCommitRequest(matcher=self.data), timeout=Cuebot.Timeout)
def testCommit(self, getStubMock): stubMock = mock.Mock() stubMock.Commit.return_value = filter_pb2.MatcherCommitResponse() getStubMock.return_value = stubMock matcher = opencue.wrappers.filter.Matcher( filter_pb2.Matcher(id=TEST_MATCHER_ID, input='test')) matcher.commit() stubMock.Commit.assert_called_with( filter_pb2.MatcherCommitRequest(matcher=matcher.data), timeout=mock.ANY)