task_tests.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_tweet_best_posts(self):
        old_likes = options.likes_to_tweet
        old_magic = options.likes_to_magic
        old_debug = options.debug
        try:
            options.likes_to_tweet = 1
            options.likes_to_magic = 1
            options.debug = False
            add_posts(shake_id=self.shake_a.id, sharedfile_id=self.shared_1.id, sourcefile_id=self.source.id)
            self.user_b.add_favorite(self.shared_1)
            # this like should trigger a tweet
            self.assertEqual(MockTweepy.count, 1)
            mf = Magicfile.get("sharedfile_id = %s", self.shared_1.id)
            self.assertIsNotNone(mf)
        finally:
            options.likes_to_tweet = old_likes
            options.likes_to_magic = old_magic
            options.debug = old_debug
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号