More mock_open bugfixes
More mock_open bugfixes

This makes readline() a regular function and not an iterator. It also
makes the different side_effect functions all operate on the same
generator representing the file contents, and adds support for reading
an explicit amount of bytes from the file. The side effect functions can
now be run one after another and the mocked filehandle will work
properly.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt