• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python six.six_next函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中six.six_next函数的典型用法代码示例。如果您正苦于以下问题:Python six_next函数的具体用法?Python six_next怎么用?Python six_next使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_author_encoding

 def test_author_encoding(self):
     # pylint: disable-msg=E1101
     a1 = six_next(self.r.get_new(url_data={'sort': 'new'})).author
     a2 = self.r.get_redditor(text_type(a1))
     self.assertEqual(a1, a2)
     s1 = six_next(a1.get_submitted())
     s2 = six_next(a2.get_submitted())
     self.assertEqual(s1, s2)
开发者ID:logan,项目名称:praw,代码行数:8,代码来源:tests.py


示例2: test_author_encoding

 def test_author_encoding(self):
     # pylint: disable-msg=E1101
     a1 = six_next(self.r.get_front_page()).author
     a2 = self.r.get_redditor(text_type(a1))
     self.assertEqual(a1, a2)
     s1 = six_next(a1.get_submitted())
     s2 = six_next(a2.get_submitted())
     self.assertEqual(s1, s2)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:8,代码来源:reddit_test.py


示例3: next

 def next(self):
     # Strip whitespace here if the reader was not able to do it by itself already (only CSV is capable of doing it currently)
     if self.manually_strip_whitespaces:
         newrow = {}
         for k, v in six_next(self.reader).iteritems():
             if isinstance(v, basestring):
                 newrow[k] = v.strip()
             else:
                 newrow[k] = v
         return newrow
     else:
         return six_next(self.reader)
开发者ID:sharafjaffri,项目名称:tablereader,代码行数:12,代码来源:__init__.py


示例4: test_equality

 def test_equality(self):
     subreddit = self.r.get_subreddit(self.sr)
     same_subreddit = self.r.get_subreddit(self.sr)
     submission = six_next(subreddit.get_hot())
     self.assertTrue(subreddit == same_subreddit)
     self.assertFalse(subreddit != same_subreddit)
     self.assertFalse(subreddit == submission)
开发者ID:logan,项目名称:praw,代码行数:7,代码来源:tests.py


示例5: test_mark_as_read

 def test_mark_as_read(self):
     oth = Reddit(USER_AGENT)
     oth.login('PyApiTestUser3', '1111')
     # pylint: disable-msg=E1101
     msg = six_next(oth.user.get_unread(limit=1))
     msg.mark_as_read()
     self.assertTrue(msg not in oth.user.get_unread(limit=5))
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:7,代码来源:reddit_test.py


示例6: test_short_link

 def test_short_link(self):
     submission = six_next(self.r.get_new(url_data={'sort': 'new'}))
     if self.r.config.is_reddit:
         self.assertTrue(submission.id in submission.short_link)
     else:
         self.assertRaises(errors.ClientException, getattr, submission,
                           'short_link')
开发者ID:logan,项目名称:praw,代码行数:7,代码来源:tests.py


示例7: test_short_link

 def test_short_link(self):
     submission = six_next(self.r.get_front_page())
     if self.r.config.is_reddit:
         self.assertTrue(submission.id in submission.short_link)
     else:
         self.assertRaises(errors.ClientException, getattr, submission,
                           'short_link')
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:7,代码来源:reddit_test.py


示例8: test_info_by_self_url_raises_warning

 def test_info_by_self_url_raises_warning(self):
     url = six_next(self.r.get_new(url_data={'sort': 'new'})).permalink
     with warnings.catch_warnings(record=True) as w:
         warnings.simplefilter('always')
         self.r.info(url)
         self.assertEqual(len(w), 1)
         self.assertEqual(w[0].category, UserWarning)
         self.assertTrue('self' in text_type(w[0].message))
开发者ID:logan,项目名称:praw,代码行数:8,代码来源:tests.py


示例9: test_add_comment_and_verify

 def test_add_comment_and_verify(self):
     text = 'Unique comment: %s' % uuid.uuid4()
     # pylint: disable-msg=E1101
     submission = six_next(self.subreddit.get_new_by_date())
     # pylint: enable-msg=E1101
     comment = submission.add_comment(text)
     self.assertEqual(comment.submission, submission)
     self.assertEqual(comment.body, text)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:8,代码来源:reddit_test.py


示例10: test_approve

 def test_approve(self):
     submission = six_next(self.subreddit.get_spam())
     if not submission:
         self.fail("Could not find a submission to approve.")
     submission.approve()
     for approved in self.subreddit.get_new_by_date():
         if approved.id == submission.id:
             break
     else:
         self.fail("Could not find approved submission.")
开发者ID:Brijen,项目名称:reddit_api,代码行数:10,代码来源:reddit_test.py


示例11: test_info_by_url_also_found_by_id

 def test_info_by_url_also_found_by_id(self):
     if self.r.config.is_reddit:
         url = 'http://imgur.com/Vr8ZZ'
     else:
         url = 'http://google.com/?q=82.1753988563'
     # pylint: disable-msg=E1101
     found_link = six_next(self.r.info(url))
     found_by_id = self.r.info(thing_id=found_link.content_id)
     self.assertTrue(found_by_id)
     self.assertTrue(found_link in found_by_id)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:10,代码来源:reddit_test.py


示例12: test_remove

 def test_remove(self):
     submission = six_next(self.subreddit.get_new_by_date())
     if not submission:
         self.fail('Could not find a submission to remove.')
     submission.remove()
     for removed in self.subreddit.get_spam():
         if removed.id == submission.id:
             break
     else:
         self.fail('Could not find removed submission.')
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:10,代码来源:reddit_test.py


示例13: test_refresh_submission

 def test_refresh_submission(self):
     subreddit = self.r.get_subreddit(self.sr)
     submission = six_next(subreddit.get_top())
     same_submission = self.r.get_submission(submission_id=submission.id)
     if submission.likes:
         submission.downvote()
     else:
         submission.upvote()
     self.assertEqual(submission.likes, same_submission.likes)
     submission.refresh()
     self.assertNotEqual(submission.likes, same_submission.likes)
开发者ID:xlevus,项目名称:praw,代码行数:11,代码来源:tests.py


示例14: stringified_row

    def stringified_row(self):
        """Ensure row contents are all strings"""

        row = six_next(self._iter)
        newrow = []
        for element in row:
            if element.value is not None:
                if isinstance(element.value, datetime):
                    element = str(element.value)
                elif element.data_type is openpyxl.cell.Cell.TYPE_NUMERIC:
                    element = str(element.value)
                else:
                    element = element.value
            else:
                element = CLEAR_STRING
            newrow.append(element)
        return newrow
开发者ID:sharafjaffri,项目名称:tablereader,代码行数:17,代码来源:__init__.py


示例15: test_get_hidden

 def test_get_hidden(self):
     item = six_next(self.r.user.get_hidden())
     item.unhide()
     self.delay()  # The queue needs to be processed
     self.assertFalse(item in list(self.r.user.get_hidden()))
开发者ID:dulichan,项目名称:praw,代码行数:5,代码来源:tests.py


示例16: test_add_link_flair_to_invalid_subreddit

 def test_add_link_flair_to_invalid_subreddit(self):
     sub = six_next(self.r.get_subreddit('bboe').get_new_by_date())
     self.assertRaises(HTTPError, self.subreddit.set_flair, sub, 'text')
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:3,代码来源:reddit_test.py


示例17: test_add_link_flair_through_submission

 def test_add_link_flair_through_submission(self):
     flair_text = 'Falir: %s' % uuid.uuid4()
     sub = six_next(self.subreddit.get_new_by_date())
     sub.set_flair(flair_text)
     sub = self.r.get_submission(sub.permalink)
     self.assertEqual(sub.link_flair_text, flair_text)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:6,代码来源:reddit_test.py


示例18: test_front_page_comment_replies_are_none

 def test_front_page_comment_replies_are_none(self):
     # pylint: disable-msg=E1101,W0212
     item = six_next(self.r.get_all_comments())
     self.assertEqual(item._replies, None)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:4,代码来源:reddit_test.py


示例19: test_liked

 def test_liked(self):
     # Pulls from get_disliked. Problem here may come from get_disliked
     item = six_next(self.r.user.get_disliked())
     item.upvote()
     self.assertTrue(item in self.r.user.get_liked())
开发者ID:xlevus,项目名称:praw,代码行数:5,代码来源:tests.py


示例20: test_get_comments_permalink

 def test_get_comments_permalink(self):
     sub = self.r.get_subreddit(self.sr)
     item = six_next(sub.get_comments())
     self.assertTrue(item.id in item.permalink)
开发者ID:Falmarri,项目名称:reddit-plasmoid,代码行数:4,代码来源:reddit_test.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python six.str函数代码示例发布时间:2022-05-27
下一篇:
Python six.reraise函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap