Add writelines_calls property

This commit is contained in:
Erik Johnson 2018-06-17 13:52:05 -05:00
parent 42fa842456
commit 543385fd02
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -138,6 +138,13 @@ class MockFH(object):
'''
return [x[1][0] for x in self.write.mock_calls]
@property
def writelines_calls(self):
'''
Return a list of all calls to the .writelines() mock
'''
return [x[1][0] for x in self.writelines.mock_calls]
def _read(self, size=0):
if not isinstance(size, six.integer_types) or size < 0:
raise TypeError('a positive integer is required')