当前位置: 首页>>代码示例>>Python>>正文


Python API.update_list方法代码示例

本文整理汇总了Python中tweepy.API.update_list方法的典型用法代码示例。如果您正苦于以下问题:Python API.update_list方法的具体用法?Python API.update_list怎么用?Python API.update_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tweepy.API的用法示例。


在下文中一共展示了API.update_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TweepyAPITests

# 需要导入模块: from tweepy import API [as 别名]
# 或者: from tweepy.API import update_list [as 别名]

#.........这里部分代码省略.........
        self.api.update_profile(
            name = original.name, url = original.url,
            location = original.location, description = original.description
        )

        for k,v in profile.items():
            if k == 'email': continue
            self.assertEqual(getattr(updated, k), v)

    def testfavorites(self):
        self.api.favorites()

    def testcreatedestroyfavorite(self):
        self.api.create_favorite(4901062372)
        self.api.destroy_favorite(4901062372)

    def testcreatedestroyblock(self):
        self.api.create_block('twitter')
        self.api.destroy_block('twitter')
        self.api.create_friendship('twitter') # restore

    def testblocks(self):
        self.api.blocks()

    def testblocksids(self):
        self.api.blocks_ids()

    def testcreateupdatedestroylist(self):
        params = {
            'owner_screen_name': username,
            'slug': 'tweeps'
        }
        l = self.api.create_list(name=params['slug'], **params)
        l = self.api.update_list(list_id=l.id, description='updated!')
        self.assertEqual(l.description, 'updated!')
        self.api.destroy_list(list_id=l.id)

    def testlistsall(self):
        self.api.lists_all()

    def testlistsmemberships(self):
        self.api.lists_memberships()

    def testlistssubscriptions(self):
        self.api.lists_subscriptions()

    def testlisttimeline(self):
        self.api.list_timeline('applepie', 'stars')

    def testgetlist(self):
        self.api.get_list(owner_screen_name='applepie', slug='stars')

    def testaddremovelistmember(self):
        params = {
            'slug': 'test',
            'owner_screen_name': username,
            'screen_name': 'twitter'
        }

        def assert_list(l):
            self.assertEqual(l.name, params['slug'])

        assert_list(self.api.add_list_member(**params))
        assert_list(self.api.remove_list_member(**params))

    def testlistmembers(self):
开发者ID:jtwaleson,项目名称:tweepy,代码行数:70,代码来源:tests.py

示例2: TweepyAPITests

# 需要导入模块: from tweepy import API [as 别名]
# 或者: from tweepy.API import update_list [as 别名]

#.........这里部分代码省略.........
            "description": "just testing things out",
        }
        updated = self.api.update_profile(**profile)
        self.api.update_profile(
            name=original.name, url=original.url, location=original.location, description=original.description
        )

        for k, v in profile.items():
            if k == "email":
                continue
            self.assertEqual(getattr(updated, k), v)

    def testfavorites(self):
        self.api.favorites()

    def testcreatedestroyfavorite(self):
        self.api.create_favorite(4901062372)
        self.api.destroy_favorite(4901062372)

    def testcreatedestroyblock(self):
        self.api.create_block("twitter")
        self.api.destroy_block("twitter")
        self.api.create_friendship("twitter")  # restore

    def testblocks(self):
        self.api.blocks()

    def testblocksids(self):
        self.api.blocks_ids()

    def testcreateupdatedestroylist(self):
        params = {"owner_screen_name": username, "slug": "tweeps"}
        l = self.api.create_list(name=params["slug"], **params)
        l = self.api.update_list(list_id=l.id, description="updated!")
        self.assertEqual(l.description, "updated!")
        self.api.destroy_list(list_id=l.id)

    def testlistsall(self):
        self.api.lists_all()

    def testlistsmemberships(self):
        self.api.lists_memberships()

    def testlistssubscriptions(self):
        self.api.lists_subscriptions()

    def testlisttimeline(self):
        self.api.list_timeline("applepie", "stars")

    def testgetlist(self):
        self.api.get_list(owner_screen_name="applepie", slug="stars")

    def testaddremovelistmember(self):
        params = {"slug": "test", "owner_screen_name": username, "screen_name": "twitter"}

        def assert_list(l):
            self.assertEqual(l.name, params["slug"])

        assert_list(self.api.add_list_member(**params))
        assert_list(self.api.remove_list_member(**params))

    def testlistmembers(self):
        self.api.list_members("applepie", "stars")

    def testshowlistmember(self):
        self.assertTrue(
开发者ID:QiaozhiWang,项目名称:tweepy,代码行数:70,代码来源:tests.py


注:本文中的tweepy.API.update_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。