-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DISCO-3182 Remove duplicated fixtures #773
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning this up! There are a few things left to cleanup:
gcs_blob_mock
was previously a fixture that returned a function and there's still traces of that in the code where it is being used as a function. e.ggcs_blob_mock(blob_json, "manifest.json")
- There are tests that are are defining mock objects when we have access to
gcs_blob_mock
, for example, this line can be changed togcs_bucket_mock.get_blob.return_value = gcs_blob_mock
- There are multiple test methods in manifest and top picks folders where we're passing in fixtures and then not using them. for example, here
These are just a few instances where we can refactor/clean up fixtures but there are more opportunities to tighten up the code here. Let me know if you need more clarification, happy to hop on a call :)
40ce58d
to
c470a03
Compare
c470a03
to
8b0f93a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
) -> None: | ||
"""Test that the get_file method returns manifest data.""" | ||
manifest_remote_filemanager.gcs_client = MagicMock() | ||
manifest_remote_filemanager.gcs_client.get_file_by_name.return_value = gcs_blob_mock | ||
gcs_blob_mock.download_as_text.return_value = blob_json | ||
|
||
get_file_result_code, result = manifest_remote_filemanager.get_file() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we add a success check for get_file_result_code
or change to _
since it's an unused variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
8b0f93a
to
d7e5410
Compare
References
JIRA: DISCO-3182
Description
Remove duplicated test fixtures.
PR Review Checklist
Put an
x
in the boxes that apply[DISCO-####]
, and has the same title (if applicable)[load test: (abort|skip|warn)]
keywords are applied to the last commit message (if applicable)