Skip to content

Commit

Permalink
Fixing test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
renoyjohnm committed Nov 26, 2024
1 parent 94ad48c commit d6ad6bd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tests/commands/test_projects_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
fake_item = mock.MagicMock()
fake_item.name = "fake-name"
fake_item.id = "fake-id"
getter = mock.MagicMock("get", return_value=([fake_item], 1))
fake_item_pagination = mock.MagicMock()
fake_item_pagination.page_number = 1
fake_item_pagination.total_available = 1
fake_item_pagination.page_size = 100
getter = mock.MagicMock("get", return_value=([fake_item], fake_item_pagination))


class ProjectsTest(unittest.TestCase):
Expand Down
7 changes: 6 additions & 1 deletion tests/commands/test_publish_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@
fake_item.pdf = b"/pdf-representation-of-view"
fake_item.extract_encryption_mode = "Disabled"

fake_item_pagination = MagicMock()
fake_item_pagination.page_number = 1
fake_item_pagination.total_available = 1
fake_item_pagination.page_size = 100

fake_job = MagicMock()
fake_job.id = "fake-job-id"

creator = MagicMock()
getter = MagicMock()
getter.get = MagicMock("get", return_value=([fake_item], 1))
getter.get = MagicMock("get", return_value=([fake_item], fake_item_pagination))
getter.publish = MagicMock("publish", return_value=fake_item)


Expand Down
9 changes: 7 additions & 2 deletions tests/commands/test_run_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,21 @@
fake_item = MagicMock()
fake_item.name = "fake-name"
fake_item.id = "fake-id"
fake_item.project_id = "fake-id"
fake_item.pdf = b"/pdf-representation-of-view"
fake_item.extract_encryption_mode = "Disabled"

fake_item_pagination = MagicMock()
fake_item_pagination.page_number = 1
fake_item_pagination.total_available = 1
fake_item_pagination.page_size = 100

fake_job = MagicMock()
fake_job.id = "fake-job-id"

creator = MagicMock()
getter = MagicMock()
getter.get = MagicMock("get", return_value=([fake_item], 1))
getter.get = MagicMock("get", return_value=([fake_item], fake_item_pagination))
getter.publish = MagicMock("publish", return_value=fake_item)
getter.create_extract = MagicMock("create_extract", return_value=fake_job)
getter.decrypt_extract = MagicMock("decrypt_extract", return_value=fake_job)
Expand Down Expand Up @@ -214,7 +220,6 @@ def test_refresh_extract(self, mock_session, mock_server):
mock_args.removecalculations = None
mock_args.incremental = None
mock_args.synchronous = None
print(mock_args)

refresh_extracts_command.RefreshExtracts.run_command(mock_args)
mock_session.assert_called()
Expand Down

0 comments on commit d6ad6bd

Please sign in to comment.