mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
remove try-except and change errno
This commit is contained in:
parent
e30afc4c01
commit
688791ff60
@ -8,11 +8,6 @@ from __future__ import absolute_import
|
|||||||
import errno
|
import errno
|
||||||
from mock import Mock
|
from mock import Mock
|
||||||
|
|
||||||
try:
|
|
||||||
ERRIO = errno.EREMOTEIO
|
|
||||||
except AttributeError:
|
|
||||||
ERRIO = errno.EIO
|
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from salttesting import TestCase
|
from salttesting import TestCase
|
||||||
from salttesting.helpers import ensure_in_syspath
|
from salttesting.helpers import ensure_in_syspath
|
||||||
@ -53,7 +48,7 @@ class FileclientTestCase(TestCase):
|
|||||||
If makedirs raises other than EEXIST errno, an exception should be raised.
|
If makedirs raises other than EEXIST errno, an exception should be raised.
|
||||||
'''
|
'''
|
||||||
with patch('os.path.isfile', lambda prm: False):
|
with patch('os.path.isfile', lambda prm: False):
|
||||||
with patch('os.makedirs', self._fake_makedir(num=ERRIO)):
|
with patch('os.makedirs', self._fake_makedir(num=errno.EIO)):
|
||||||
with self.assertRaises(OSError):
|
with self.assertRaises(OSError):
|
||||||
with Client(self.opts)._cache_loc('testfile') as c_ref_itr:
|
with Client(self.opts)._cache_loc('testfile') as c_ref_itr:
|
||||||
assert c_ref_itr == '/__test__/files/base/testfile'
|
assert c_ref_itr == '/__test__/files/base/testfile'
|
||||||
|
Loading…
Reference in New Issue
Block a user