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

write to files #136

Open
lukesg08 opened this issue Nov 21, 2024 · 2 comments
Open

write to files #136

lukesg08 opened this issue Nov 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@lukesg08
Copy link
Collaborator

Support for writing to file would be great. Right now, even if I try to mock the open function and/or change _OPEN_FORBIDDEN_MODES, I don't seem to be able to allow file writes in Pedal.

@lukesg08 lukesg08 added the enhancement New feature or request label Nov 21, 2024
@lukesg08
Copy link
Collaborator Author

lukesg08 commented Nov 21, 2024

I don't think there's any easy access to any mock files the student has written to, as to even get write functionality I had to remock the open function to allow writing:

mocked.create_open_function(MAIN_REPORT, forbidden_names=re.compile(r"(^[./])|(\.py$)"),
                                        forbidden_modes=re.compile(r"X"))

but perhaps there's an easier way...also, I don' t think this actually works

@acbart
Copy link
Collaborator

acbart commented Nov 21, 2024 via email

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

No branches or pull requests

2 participants