Skip to content
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

TBOX-185, TBOX-139: Improve operation.wait() function; improve test coverage #175

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

ErinCompaan
Copy link
Contributor

↪️ Pull Request

For TBOX-185, this updates tamr_toolbox/utils/operation.py's function wait to use the monitor function.

It also adds a catch to monitor function to return immediately if the operation is complete (in testing, I observed that if I accidentally sent the operation ID of a complete job to the monitor function, it would poll it indefinitely waiting for a state change).

Along with testing for these changes, this PR adds test coverage for the operations.py functions to address TBOX-139. Test coverage for operations.py is 100% with these changes.

✔️ PR Todo

op = from_resource_id(client, job_id="-1")

with mock.patch.object(
tamr_unify_client.operation.Operation, attribute="status", new=None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit convoluted in an attempt to test the operation.status is None cases in the monitor/wait functions. I don't know how that would arise in practice so I put some mocks in to generate. If anyone knows how such an op can arise, please let me know. It would be better to test a realistic scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant