def test_big_summary(self): msg = rpc_pb2.CancelBuildRequest( id=1, summary_markdown='a very long string' ) self.assert_invalid( msg, r'summary_markdown: too big to accept \(18 > 10 bytes\)' )
def test_cancel(self, cancel_async): cancel_async.return_value = future( test_util.build(id=54, status=common_pb2.CANCELED), ) req = rpc_pb2.CancelBuildRequest(id=54, summary_markdown='unnecesary') res = self.call(self.api.CancelBuild, req) self.assertEqual(res.id, 54) self.assertEqual(res.status, common_pb2.CANCELED) cancel_async.assert_called_once_with(54, summary_markdown='unnecesary')
def test_no_build(self): msg = rpc_pb2.CancelBuildRequest(summary_markdown='unnecessary') self.assert_invalid(msg, 'id: required')
def test_valid(self): msg = rpc_pb2.CancelBuildRequest(id=1, summary_markdown='unnecessary') self.assert_valid(msg)