Skip to content

Commit

Permalink
Fix issue with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Diljot Garcha committed Nov 2, 2023
1 parent ebeec8e commit 51902a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/services/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ def get_next_production(

if not production_list:
response = self.tmdb.get_list(TMDB_MCU_LIST)
production_list = response["items"]
current_page = response["page"]
total_num_pages = response["total_pages"]

if current_page < total_num_pages:
response = self.tmdb.get_list(TMDB_MCU_LIST, total_num_pages)
if response:
production_list = response["items"]
current_page = response["page"]
total_num_pages = response["total_pages"]

if current_page < total_num_pages:
response = self.tmdb.get_list(TMDB_MCU_LIST, total_num_pages)
production_list = response["items"]

if production_list:
if not desired_date:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setUp(self):
)

def test_send_request(self):
expected_data = "https://api.themoviedb.org/3/lists?api_key=CXdrQrBgAL3HET3mMmMt&language=en-CA"
expected_data = "https://api.themoviedb.org/3/lists?api_key=CXdrQrBgAL3HET3mMmMt&language=en-CA&page=1"
data = self.tmdb.send_request("lists").url
self.assertEqual(data, expected_data)

Expand Down

0 comments on commit 51902a3

Please sign in to comment.