Example #1
0
    def test_a_search_data_source_should_know_how_to_process_response(self):
        fetcher = ApiStubFetcher()
        client = ApiClient('http://somewhere.com/', API_KEY, fetcher=fetcher)
        data_source = SearchDataSource(client)
        data = data_source.fetch_data()

        assert len(data) == 2
        result = data[1]
        assert result.has_key('id')
        assert result.has_key('apiUrl')
        assert result.has_key('webPublicationDate')
        assert result.has_key('sectionName')
        assert result.has_key('webTitle')
        assert result.has_key('fields')
        assert result.has_key('sectionName')
    def test_a_search_data_source_should_know_how_to_process_response(self):
        fetcher = ApiStubFetcher()
        client = ApiClient('http://somewhere.com/', API_KEY, fetcher=fetcher)
        data_source = SearchDataSource(client)
        data = data_source.fetch_data()

        assert len(data) == 2
        result = data[1]
        assert result.has_key('id')
        assert result.has_key('apiUrl')
        assert result.has_key('webPublicationDate')
        assert result.has_key('sectionName')
        assert result.has_key('webTitle')
        assert result.has_key('fields')
        assert result.has_key('sectionName')
Example #3
0
 def __init__(self, client):
     SearchDataSource.__init__(self, client)
     self.section = 'environment'
     self.production_office = 'aus'
Example #4
0
 def __init__(self, client):
     SearchDataSource.__init__(self, client)
     self.tags = ['type/video,australia-news/australia-news']
Example #5
0
 def __init__(self, client):
     SearchDataSource.__init__(self, client)
     self.section = 'environment'
     self.production_office = 'aus'
Example #6
0
 def __init__(self, client):
     SearchDataSource.__init__(self, client)
     self.tags = ['type/video,australia-news/australia-news']