mock stdout unit test patch failure fix

Adjust some mock.patch behavior to match the new stdout behavior where
we need to check a file's size as well as its existence
This commit is contained in:
Matthew Jones 2015-08-05 10:01:16 -04:00
parent b1c12ca120
commit 57778eb429

View File

@ -23,7 +23,8 @@ class UnifiedJobsUnitTest(SimpleTestCase):
unified_job = UnifiedJob()
unified_job.result_stdout_file = 'dummy'
result = unified_job.result_stdout_raw_handle()
with mock.patch('os.stat', st_size=1):
result = unified_job.result_stdout_raw_handle()
self.assertEqual(result, 'my_file_handler')