From 57778eb4297eb9f64df1839cf2d087c644c3e095 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 5 Aug 2015 10:01:16 -0400 Subject: [PATCH] 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 --- awx/main/tests/unified_jobs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/unified_jobs.py b/awx/main/tests/unified_jobs.py index 607feeec4e..41dcf79d26 100644 --- a/awx/main/tests/unified_jobs.py +++ b/awx/main/tests/unified_jobs.py @@ -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')