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

Pyfakefs doesn't support relative paths #16

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments
Closed

Pyfakefs doesn't support relative paths #16

GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments
Labels

Comments

@GoogleCodeExporter
Copy link

Pyfakefs doesn't seem to support using relative paths with operations in the os 
module, such as "mkdir", "remove" or "rename".  The documentation for "mkdir" 
even notes that relative paths are relative to root.

This makes it impossible to do something like 

fake_os.mkdir("foo")  # works
fake_os.rename("foo", "bar") # fails as os.rename doesn't recognize foo as 
relative to root

Or:
fake_os.mkdir("foo")
fake_os.mkdir("foo/bar")  # works
fake_os.chdir("foo")  # works
fake_os.remove("bar") # remove looks for "bar" at the root

When testing code that interacts with the it's helpful to write tests that 
exercise both relative and absolute paths.

Is there a reason this functionality is not implemented to match a real file 
system?

Original issue reported on code.google.com by londinop on 6 May 2013 at 4:13

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 8 May 2013 at 6:18

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 8 May 2013 at 11:41

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision b14b755537a2.

Original comment by [email protected] on 13 May 2013 at 8:04

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

No branches or pull requests

2 participants