mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03:30
fix bad mocking
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
# Python
|
# Python
|
||||||
import mock
|
import mock
|
||||||
|
from mock import Mock
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ class UnifiedJobsUnitTest(SimpleTestCase):
|
|||||||
unified_job = UnifiedJob()
|
unified_job = UnifiedJob()
|
||||||
unified_job.result_stdout_file = 'dummy'
|
unified_job.result_stdout_file = 'dummy'
|
||||||
|
|
||||||
with mock.patch('os.stat', st_size=1):
|
with mock.patch('os.stat', return_value=Mock(st_size=1)):
|
||||||
result = unified_job.result_stdout_raw_handle()
|
result = unified_job.result_stdout_raw_handle()
|
||||||
|
|
||||||
self.assertEqual(result, 'my_file_handler')
|
self.assertEqual(result, 'my_file_handler')
|
||||||
|
|||||||
Reference in New Issue
Block a user