def test_getStocksSummariesForUser_pagination(): news_page_1 = operations.getStocksSummariesForUser('test', 1) news_page_2 = operations.getStocksSummariesForUser('test', 2) assert len(news_page_1) > 0 assert len(news_page_2) > 0 # Assert that there is no dupe news in two pages. digests_page_1_set = Set([news['index'] for news in news_page_1]) digests_page_2_set = Set([news['index'] for news in news_page_2]) assert len(digests_page_1_set.intersection(digests_page_2_set)) == 0 print 'test_getNewsSummariesForUser_pagination passed!'
def getStocksSummariesForUser(self, user_id, page_num): return operations.getStocksSummariesForUser(user_id, page_num)
def test_getStocksSummariesForUser_basic(): news = operations.getStocksSummariesForUser('test', 1) print news assert len(news) > 0 print 'test_getStocksSummariesForUser_basic passed!'