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

Remove unneeded implementations from fake shutil #194

Closed
mrbean-bremen opened this issue May 28, 2017 · 3 comments · Fixed by #222
Closed

Remove unneeded implementations from fake shutil #194

mrbean-bremen opened this issue May 28, 2017 · 3 comments · Fixed by #222
Assignees

Comments

@mrbean-bremen
Copy link
Member

This one depends on the implementation of #189, #192 and #193.
Most of the implementation of shutil depends only on os functionality that is already faked out and can be safely removed.

@jmcgeheeiv
Copy link
Contributor

I see. You are saying that we can let Patcher go inside shutil and stub out all the references to os and other faked modules. Correct?

@mrbean-bremen
Copy link
Member Author

Yes, this is actually what we are already doing, since I removed shutil from SKIPNAMES. This is how shutil.make_archive and other functions work. I'm just saying that we can remove more of the fake implementation (most of it, actually).

@jmcgeheeiv
Copy link
Contributor

An excellent discovery.

When you remove the fake functionality, you will remove tests as well, but please leave one or two tests as canaries.

For example, leave the test for shutil.copyfile(). You will have removed the fake shutil.copyfile(), so the test will exercise the real shutil.copyfile(). If the real shutil.copyfile() passes the test, we can assume that the rest of the real shutil is properly exposed and not patched.

@mrbean-bremen mrbean-bremen self-assigned this Jun 10, 2017
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 10, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- FakePathModule: do not implement samefile if not existent
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 10, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- FakePathModule: do not implement samefile if not existent
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 10, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- FakePathModule: do not implement samefile if not existent
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 11, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- FakePathModule: do not implement samefile if not existent
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 11, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- FakePathModule: do not implement samefile if not existent
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fixed handling of supports_dir_fd
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fixed handling of supports_dir_fd
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 17, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests to work with the real shutil
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jun 18, 2017
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes pytest-dev#194
jmcgeheeiv pushed a commit that referenced this issue Jun 18, 2017
* Removed most of FakeShutilModule functionality
- adapted tests to work with fake_filesystem_unittest.TestCase
- fixed some tests
- fake_filesystem.ResolvePath: consider alternative path separator for resolving links
- fixes #194

* Correct docstring for disk_usage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants