コード例 #1
0
 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()
コード例 #2
0
 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()