Skip to content

Commit

Permalink
adds test_get_temp_file_deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom O'Hara committed Sep 16, 2024
1 parent 2f0cf32 commit 958f3a9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mezcla/tests/test_glue_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,21 @@ def test_delete_directory(self):

THE_MODULE.DISABLE_RECURSIVE_DELETE = old

@pytest.mark.xfail
def test_get_temp_file_deletion(self):
"""Make sure temp file returned properly when TEMP_FILE not set
Note: accounts for odd NamedTemporaryFile behavior with delete
"""
self.monkeypatch.setattr(gh, 'TEMP_FILE', None)
#
self.monkeypatch.setattr(gh, 'KEEP_TEMP', True)
temp_file_without_delete = THE_MODULE.get_temp_file(delete=False)
assert system.file_exists(temp_file_without_delete)
#
self.monkeypatch.setattr(gh, 'KEEP_TEMP', False)
temp_file_with_delete = THE_MODULE.get_temp_file(delete=True)
assert system.file_exists(temp_file_with_delete)

@pytest.mark.xfail
def test_initialization(self):
"""Make sure module initialized OK"""
Expand Down

0 comments on commit 958f3a9

Please sign in to comment.