diff --git a/mediacloud/api.py b/mediacloud/api.py index 8487d85..8928fd8 100644 --- a/mediacloud/api.py +++ b/mediacloud/api.py @@ -63,9 +63,9 @@ class DirectoryApi(BaseApi): PLATFORM_TWITTER = "twitter" PLATFORM_REDDIT = "reddit" - def collection(self, id_: int): + def collection(self, collection_id: int): - return self._query(f'sources/collections/{id_}/', None) + return self._query(f'sources/collections/{collection_id}/', None) def collection_list(self, platform: Optional[str] = None, name: Optional[str] = None, limit: Optional[int] = 0, offset: Optional[int] = 0) -> Dict: @@ -76,8 +76,8 @@ def collection_list(self, platform: Optional[str] = None, name: Optional[str] = params['platform'] = platform return self._query('sources/collections/', params) - def source(self, id_:int): - return self._query(f'sources/sources/{id_}/', None) + def source(self, source_id:int): + return self._query(f'sources/sources/{source_id}/', None) def source_list(self, platform: Optional[str] = None, name: Optional[str] = None, collection_id: Optional[int] = None, diff --git a/mediacloud/test/api_directory_test.py b/mediacloud/test/api_directory_test.py index 0c4333b..df88f1b 100644 --- a/mediacloud/test/api_directory_test.py +++ b/mediacloud/test/api_directory_test.py @@ -108,11 +108,11 @@ def test_feed_list_modified_before(self): assert len(feeds) > 0 def test_get_collection(self): - us_national_id = "34412234" + us_national_id = 34412234 response = self._directory.collection(us_national_id) assert response["name"] == "United States - National" def test_get_source(self): - nyt_id = "1" + nyt_id = 1 response = self._directory.source(nyt_id) assert response["name"] == "nytimes.com" \ No newline at end of file