Esempio n. 1
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             'us/sport',
                             show_editors_picks=True)
     self.show_tags = ['keyword']
     self.show_elements = 'image'
Esempio n. 2
0
 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')
Esempio n. 5
0
    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')
Esempio n. 6
0
 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')
Esempio n. 7
0
 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'
Esempio n. 8
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='technology')
     self.tags = ['type/podcast']
Esempio n. 9
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='australia-news')
     self.show_elements = 'image'
Esempio n. 10
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             content_id='technology',
                             show_most_viewed=True)
Esempio n. 11
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, "lifeandstyle/australia-food-blog")
Esempio n. 12
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='australia-news/australian-politics')
Esempio n. 13
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='fashion')
     self.tags = ['fashion/series/jess-cartner-morley-on-fashion']
Esempio n. 14
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='world', show_editors_picks=True)
     self.show_elements = 'image'
Esempio n. 15
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='technology')
     self.tags = ['type/podcast']
Esempio n. 16
0
 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'
Esempio n. 17
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='technology', show_most_viewed=True)
Esempio n. 18
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='technology/games')
     self.tags = ['-technology/series/chatterbox,-type/video']
Esempio n. 19
0
 def __init__(self, client):
     ItemDataSource.__init__(
         self,
         client,
         content_id='fashion/series/guardian-fashion-blogs-network')
Esempio n. 20
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             content_id='fashion',
                             show_editors_picks=True)
     self.page_size = 20
Esempio n. 21
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             content_id='fashion/fashion-blog')
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='fashion/fashion-blog')
Esempio n. 23
0
 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)
Esempio n. 25
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='books/booksblog')
Esempio n. 26
0
	def __init__(self, client):
		ItemDataSource.__init__(self, client, content_id='news/series/the-audio-long-read')
Esempio n. 27
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='books')
     self.tags = ['type/audio']
Esempio n. 28
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, "us/sport", show_editors_picks=True)
     self.show_tags = ["keyword"]
     self.show_elements = "image"
Esempio n. 29
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             content_id='books',
                             show_editors_picks=True)
Esempio n. 30
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, '/au/commentisfree', show_editors_picks=True, only_editors_picks=True)
Esempio n. 31
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client,
                             "lifeandstyle/australia-food-blog")
Esempio n. 32
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='australia-news/australian-politics')
     self.tags = ['type/video']
Esempio n. 33
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             content_id='fashion',
                             show_most_viewed=True)
Esempio n. 34
0
 def __init__(self, client, edition_path):
     ItemDataSource.__init__(self,
                             client,
                             content_id=edition_path,
                             show_editors_picks=True)
Esempio n. 35
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, show_editors_picks=True)
Esempio n. 36
0
 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, content_id='fashion', show_most_viewed=True)
 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')
		self.tags = ['fashion/series/jess-cartner-morley-on-fashion']
 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')
Esempio n. 42
0
 def __init__(self, client):
     ItemDataSource.__init__(self,
                             client,
                             '/au/commentisfree',
                             show_editors_picks=True,
                             only_editors_picks=True)
Esempio n. 43
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='fashion')
     self.tags = ['fashion/series/sali-hughes-beauty']
Esempio n. 44
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, show_most_viewed=True)
Esempio n. 45
0
 def __init__(self, client):
     ItemDataSource.__init__(
         self, client, content_id='australia-news/australian-politics')
Esempio n. 46
0
 def __init__(self, client):
     ItemDataSource.__init__(
         self, client, content_id='australia-news/australian-politics')
     self.tags = ['type/video']
Esempio n. 47
0
 def __init__(self, client):
     ItemDataSource.__init__(self, client, content_id='australia-news')
     self.show_elements = 'image'
Esempio n. 48
0
 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='fashion')
     self.tags = ['fashion/series/sali-hughes-beauty']