Skip to content

Commit

Permalink
correct typing in tests, variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Paige Gulley committed Nov 1, 2024
1 parent 67d5e2c commit 50e297b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions mediacloud/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions mediacloud/test/api_directory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 50e297b

Please sign in to comment.