本文整理汇总了Python中hackernews.HackerNews.job_stories方法的典型用法代码示例。如果您正苦于以下问题:Python HackerNews.job_stories方法的具体用法?Python HackerNews.job_stories怎么用?Python HackerNews.job_stories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hackernews.HackerNews
的用法示例。
在下文中一共展示了HackerNews.job_stories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestjobStories
# 需要导入模块: from hackernews import HackerNews [as 别名]
# 或者: from hackernews.HackerNews import job_stories [as 别名]
class TestjobStories(unittest.TestCase):
def setUp(self):
self.hn = HackerNews()
def test_job_stories(self):
job_stories = self.hn.job_stories()
self.assertIsInstance(job_stories, list)
self.assertIsNotNone(job_stories)
示例2: TestJobStories
# 需要导入模块: from hackernews import HackerNews [as 别名]
# 或者: from hackernews.HackerNews import job_stories [as 别名]
class TestJobStories(unittest.TestCase):
def setUp(self):
self.hn = HackerNews()
def test_job_stories(self):
job_stories = self.hn.job_stories(limit=10)
self.assertIsInstance(job_stories, list)
self.assertIsInstance(job_stories[0], Item)
self.assertIsNotNone(job_stories)
def test_job_stories_raw(self):
job_stories = self.hn.job_stories(raw=True)
self.assertIsInstance(job_stories, list)
self.assertIsInstance(job_stories[0], str)
self.assertIsNotNone(job_stories)
def tearDown(self):
self.hn.session.close()