-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Write test for get_inode
#2673
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
Write test for get_inode
#2673
Conversation
|
@efiop I thought I would delete https://github.com/iterative/dvc/blob/1baf020de7c3b0024807f30bc7e9eec39a37948c/dvc/state.py#L373 because we were replacing |
|
@efiop The |
tests/unit/utils/test_fs.py
Outdated
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.
You are not mocking anything in this test
| # Mocking a file to get the inode. |
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.
@efiop I am creating a file FOO so that I can mock a path. Isn't this called mocking?
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.
Mocking is when you simulate something, and here you are testing on a real file, so I wouldn't call that mocking.
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.
@efiop Oh okay. But how does it delete the file later?
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.
@efiop Can you answer this, please? :)
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.
@algomaster99 Sorry, missed this. Yes, it deletes it. See dvc_repo fixture in tests/conftest.py.
efiop
left a comment
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.
Please see comments above
Yes, it should accept both str and path_info too, but let's fix it in a separate PR 🙂
Got it. Yes, this PR is mergable by itself so let's finish this and proceed with |
efiop
left a comment
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.
Looks good! Let's remove that comment and we will be ready to merge 🙂
efiop
left a comment
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.
Perfect! Thanks! 🎉
Have you followed the guidelines in our
Contributing document?
Does your PR affect documented changes or does it add new functionality
that should be documented? If yes, have you created a PR for
dvc.org documenting it or at
least opened an issue for it? If so, please add a link to it.
With reference to #2137
Testing if
get_inodecan take both - Path-like objects and strings.