Open GoogleCodeExporter opened 9 years ago
I would like to use this as well. I've come up with a patch that implements the
functionality, along with a unit test for it.
Original comment by wheaties...@gmail.com
on 2 Jan 2014 at 8:05
Attachments:
Apparently there's a better way to make patches with hg :)
Original comment by wheaties...@gmail.com
on 2 Jan 2014 at 8:06
Attachments:
I implemented this using a new optional argument to mock_open called "lines".
It could be useful to instead just set handle.__iter__.return_value =
read_data.splitlines(), but that may break existing tests.
Original comment by wheaties...@gmail.com
on 2 Jan 2014 at 8:09
Looks like there are some whitespace issues, but otherwise this LGTM and would
be helpful in making mock_open usage much cleaner
Original comment by Yasumo...@gmail.com
on 18 Apr 2014 at 1:52
If you take a look at http://bugs.python.org/issue17467, you may want to check
read data to see if it's a list and patch appropriately vs. adding a new lines
argument too tho. Since mock's in the std lib, you'll want to move this to
bugs.python.org if you wanna carry this over the finish line too, I think :)
Original comment by Yasumo...@gmail.com
on 18 Apr 2014 at 2:25
Original issue reported on code.google.com by
kram4...@gmail.com
on 12 Sep 2013 at 10:34