mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Track call_count in MockOpen
This commit is contained in:
parent
2598d2453a
commit
fc0aa9934f
1 changed files with 2 additions and 0 deletions
|
@ -316,12 +316,14 @@ class MockOpen(object):
|
|||
|
||||
self.read_data = read_data
|
||||
self.filehandles = {}
|
||||
self.call_count = 0
|
||||
|
||||
def __call__(self, name, *args, **kwargs):
|
||||
'''
|
||||
Match the file being opened to the patterns in the read_data and spawn
|
||||
a mocked filehandle with the corresponding file contents.
|
||||
'''
|
||||
self.call_count += 1
|
||||
for pat in self.read_data:
|
||||
if pat == '*':
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue