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

Fix tests fstools #138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

dbungert
Copy link
Collaborator

@dbungert dbungert commented Sep 8, 2023

The probert unit tests may fail, depending on if filesystem tools are installed on the host system. We don't actually run them, that's already mocked out. Mock out the check for them existing.

These tests would only pass if the relevant tools were actually
installed, but we're not running them.
@dbungert dbungert requested a review from ogayot September 8, 2023 20:27
Copy link
Collaborator

@mwhudson mwhudson left a comment

Choose a reason for hiding this comment

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

TIL @patch works on classes.

This is fine I guess. Did you consider a "ProbertTestCase" that does this mocking in setUp()?

@dbungert
Copy link
Collaborator Author

Did you consider a "ProbertTestCase" that does this mocking in setUp()?

I've pushed a sample commit with that, I think in this case it's not ideal as the name to patch is different for filesystem vs os. If I'm missing something let me know.

@mwhudson
Copy link
Collaborator

Did you consider a "ProbertTestCase" that does this mocking in setUp()?

I've pushed a sample commit with that, I think in this case it's not ideal as the name to patch is different for filesystem vs os. If I'm missing something let me know.

Hm that's true (and it looks like you're patching the wrong path in test_os now?). Can we just patch the shutil module direclty instead though?

@dbungert
Copy link
Collaborator Author

I pushed another version, I'm kind of ambivalent about the result though. I think in some cases this would be net beneficial but less so this one.

Copy link
Collaborator

@mwhudson mwhudson left a comment

Choose a reason for hiding this comment

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

Hmm I think this is OK, but well. Do what you like :-)

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.

3 participants