Skip to content

Commit

Permalink
Add test for directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
agyoungs committed Oct 6, 2023
1 parent 6462423 commit 32d9f9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_file_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def get_name(cls):
def get_files(self, cliargs):
all_files = {}
all_files['test_file.txt'] = """The quick brown fox jumped over the lazy dog.
%s""" % cliargs
all_files['path/to/test_file.txt'] = """The quick brown fox jumped over the lazy dog.
%s""" % cliargs
all_files['/absolute.txt'] = """Absolute file path should be skipped"""
return all_files
Expand Down Expand Up @@ -89,4 +91,10 @@ def test_file_injection(self):
self.assertIn('test_key', content)
self.assertIn('test_value', content)

with open(os.path.join(td, 'path/to/test_file.txt'), 'r') as fh:
content = fh.read()
self.assertIn('quick brown', content)
self.assertIn('test_key', content)
self.assertIn('test_value', content)

self.assertFalse(os.path.exists('/absolute.txt'))

0 comments on commit 32d9f9c

Please sign in to comment.