def __init__(self, client): ItemDataSource.__init__(self, client, 'us/sport', show_editors_picks=True) self.show_tags = ['keyword'] self.show_elements = 'image'
def __init__(self, client): ItemDataSource.__init__(self, client, 'technology', show_editors_picks=True) self.name = 'technology' + client.edition self.show_tags = ['keyword'] self.show_elements = 'image'
def test_should_call_api_with_correct_url_for_life_and_technology(self): tech_ds = ItemDataSource(url_capturing_client, 'technology', show_editors_picks=True) tech_ds.name = 'technology' + url_capturing_client.edition self.check_data_source_url(tech_ds, '/technology', show_fields=Fields, show_editors_picks='true', page_size='10', user_tier='internal')
def test_should_send_tags_to_capi(self): ds = ItemDataSource(url_capturing_client, content_id='music') ds.tags = ['-type/audio','tone/news'] self.check_data_source_url(ds, '/music', show_fields=Fields, user_tier='internal', page_size=DEFAULT_PAGE_SIZE, tag='-type/audio,tone/news')
def test_should_send_tags_to_capi(self): ds = ItemDataSource(url_capturing_client, content_id='music') ds.tags = ['-type/audio', 'tone/news'] self.check_data_source_url(ds, '/music', show_fields=Fields, user_tier='internal', page_size=DEFAULT_PAGE_SIZE, tag='-type/audio,tone/news')
def test_should_append_blog_item_to_content_where_there_is_one_blog_entry( self): fetcher = ApiStubFetcher() client = ApiClient('http://content.guardianapis.com/', API_KEY, fetcher=fetcher) blog_data_source = ItemDataSource(client, '/i/want/a/blog/item') section_data_source = ItemDataSource(client, '/i/want/a/section') data_source = ItemPlusBlogDataSource(section_data_source, blog_data_source) data = data_source.fetch_data() assert len(data) == 4 result = data[0] assert result['id'] == 'blog id' assert result['sectionName'] == 'blog section name' assert result['sectionId'] == 'blog section id' result = data[1] assert result['id'] == 'section id' assert result['sectionName'] == 'Politics' assert result['sectionId'] == 'politics'
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='technology') self.tags = ['type/podcast']
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='australia-news') self.show_elements = 'image'
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='technology', show_most_viewed=True)
def __init__(self, client): ItemDataSource.__init__(self, client, "lifeandstyle/australia-food-blog")
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='australia-news/australian-politics')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='fashion') self.tags = ['fashion/series/jess-cartner-morley-on-fashion']
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='world', show_editors_picks=True) self.show_elements = 'image'
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='technology/games') self.tags = ['-technology/series/chatterbox,-type/video']
def __init__(self, client): ItemDataSource.__init__( self, client, content_id='fashion/series/guardian-fashion-blogs-network')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='fashion', show_editors_picks=True) self.page_size = 20
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='fashion/fashion-blog')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='books') self.tags = ['tone/reviews']
def __init__(self, client): ItemDataSource.__init__(self, client, show_editors_picks=True)
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='books/booksblog')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='news/series/the-audio-long-read')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='books') self.tags = ['type/audio']
def __init__(self, client): ItemDataSource.__init__(self, client, "us/sport", show_editors_picks=True) self.show_tags = ["keyword"] self.show_elements = "image"
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='books', show_editors_picks=True)
def __init__(self, client): ItemDataSource.__init__(self, client, '/au/commentisfree', show_editors_picks=True, only_editors_picks=True)
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='australia-news/australian-politics') self.tags = ['type/video']
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='fashion', show_most_viewed=True)
def __init__(self, client, edition_path): ItemDataSource.__init__(self, client, content_id=edition_path, show_editors_picks=True)
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='games') self.tags = ['-technology/series/chatterbox,-type/video']
def __init__(self, client): ItemDataSource.__init__(self, client, show_most_viewed=True)
def __init__(self, client ): ItemDataSource.__init__(self, client, content_id='fashion/series/guardian-fashion-blogs-network')
def __init__(self, client): ItemDataSource.__init__(self, client, content_id='fashion') self.tags = ['fashion/series/sali-hughes-beauty']
def __init__(self, client): ItemDataSource.__init__( self, client, content_id='australia-news/australian-politics')
def __init__(self, client): ItemDataSource.__init__( self, client, content_id='australia-news/australian-politics') self.tags = ['type/video']