本文整理匯總了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()