Ejemplo n.º 1
0
 def test_send_feedcard_old_api(self):
     """测试发送FeedCard类型消息功能(FeedLink旧API)"""
     feedlink1 = FeedLink(title="氧气美女", message_url="https://www.dingtalk.com/", pic_url="https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
     feedlink2 = FeedLink(title="氧眼美女", message_url="https://www.dingtalk.com/", pic_url="https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
     feedlink3 = FeedLink(title="氧神美女", message_url="https://www.dingtalk.com/", pic_url="https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
     links = [feedlink1, feedlink2, feedlink3]
     result = self.xiaoding.send_feed_card(links)
     self.assertEqual(result['errcode'], 0)
Ejemplo n.º 2
0
 def test_send_feedcard_old_api(self):
     """测试发送FeedCard类型消息功能(FeedLink旧API)"""
     feedlink1 = FeedLink(
         title="氧气美女",
         message_url="https://www.dingtalk.com/",
         pic_url=
         "http://pic1.win4000.com/wallpaper/2020-03-11/5e68b0557f3a6.jpg")
     feedlink2 = FeedLink(
         title="氧眼美女",
         message_url="https://www.dingtalk.com/",
         pic_url=
         "http://pic1.win4000.com/wallpaper/2020-03-11/5e68b0557f3a6.jpg")
     feedlink3 = FeedLink(
         title="氧神美女",
         message_url="https://www.dingtalk.com/",
         pic_url=
         "http://pic1.win4000.com/wallpaper/2020-03-11/5e68b0557f3a6.jpg")
     links = [feedlink1, feedlink2, feedlink3]
     result = self.xiaoding.send_feed_card(links)
     self.assertEqual(result['errcode'], 0)
Ejemplo n.º 3
0
        "title": "反对",
        "actionURL": "https://www.dingtalk.com/"
    }]
    actioncard3 = ActionCard(
        title='万万没想到,竟然...',
        text=
        '![选择](http://www.songshan.es/wp-content/uploads/2016/01/Yin-Yang.png) \n### 故事是这样子的...',
        btns=btns3,
        btn_orientation=1,
        hide_avatar=1)
    xiaoding.send_action_card(actioncard3)

    # FeedCard类型
    feedlink1 = FeedLink(
        title="氧气美女",
        message_url="https://www.dingtalk.com/",
        pic_url=
        "https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
    feedlink2 = FeedLink(
        title="氧眼美女",
        message_url="https://www.dingtalk.com/",
        pic_url=
        "https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
    feedlink3 = FeedLink(
        title="氧神美女",
        message_url="https://www.dingtalk.com/",
        pic_url=
        "https://unzippedtv.com/wp-content/uploads/sites/28/2016/02/asian.jpg")
    links = [feedlink1.get_data(), feedlink2.get_data(), feedlink3.get_data()]
    xiaoding.send_feed_card(links)