def test_send_not_support_type(self): config = { 'dingding_conn_id': self.conn_id, 'message_type': 'not_support_type', 'message': 'Airflow dingding text message remind no one', } hook = DingdingHook(**config) with pytest.raises(ValueError): hook.send()
def execute(self, context): self.log.info('Sending Dingding message.') hook = DingdingHook( self.dingding_conn_id, self.message_type, self.message, self.at_mobiles, self.at_all ) hook.send()