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