Skip to content

Commit

Permalink
Add test for interpolating byte strings in hook plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwilsdon committed Feb 25, 2019
1 parent 9bb6c29 commit 25549a6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ def test_hook_argument_substitution(self):
self.assertTrue(os.path.isfile(path))
os.remove(path)

def test_hook_bytes_interpolation(self):
temporary_paths = [
get_temporary_path().encode('utf-8')
for i in range(self.TEST_HOOK_COUNT)
]

for index, path in enumerate(temporary_paths):
self._add_hook('test_bytes_event_{0}'.format(index),
'touch "{path}"')

self.load_plugins('hook')

for index, path in enumerate(temporary_paths):
plugins.send('test_bytes_event_{0}'.format(index), path=path)

for path in temporary_paths:
self.assertTrue(os.path.isfile(path))
os.remove(path)


def suite():
return unittest.TestLoader().loadTestsFromName(__name__)
Expand Down

0 comments on commit 25549a6

Please sign in to comment.