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