Reworked mocking of NamedTemporaryFile() (#8)

This commit is contained in:
Chris Caron
2020-01-13 19:30:00 -05:00
committed by GitHub
parent 2185737911
commit 9289834660
4 changed files with 10 additions and 10 deletions

View File

@ -162,8 +162,8 @@ class AddTests(SimpleTestCase):
)
assert response.status_code == 400
with patch('tempfile._TemporaryFileWrapper') as mock_ntf:
mock_ntf.side_effect = OSError()
with patch('tempfile.NamedTemporaryFile') as mock_ntf:
mock_ntf.side_effect = OSError
# we won't be able to write our retrieved configuration
# to disk for processing; we'll get a 500 error
response = self.client.post(