mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Skip utils_test if timelib is not installed (#32699)
date_cast() throws a RuntimeError, not an ImportError
This commit is contained in:
parent
d1d806f893
commit
29814f9d43
@ -527,14 +527,9 @@ class UtilsTestCase(TestCase):
|
|||||||
ret = utils.date_cast('Mon Dec 23 10:19:15 MST 2013')
|
ret = utils.date_cast('Mon Dec 23 10:19:15 MST 2013')
|
||||||
expected_ret = datetime.datetime(2013, 12, 23, 10, 19, 15)
|
expected_ret = datetime.datetime(2013, 12, 23, 10, 19, 15)
|
||||||
self.assertEqual(ret, expected_ret)
|
self.assertEqual(ret, expected_ret)
|
||||||
except ImportError:
|
except RuntimeError:
|
||||||
try:
|
# Unparseable without timelib installed
|
||||||
ret = utils.date_cast('Mon Dec 23 10:19:15 MST 2013')
|
self.skipTest('\'timelib\' is not installed')
|
||||||
expected_ret = datetime.datetime(2013, 12, 23, 10, 19, 15)
|
|
||||||
self.assertEqual(ret, expected_ret)
|
|
||||||
except RuntimeError:
|
|
||||||
# Unparseable without timelib installed
|
|
||||||
self.skipTest('\'timelib\' is not installed')
|
|
||||||
|
|
||||||
@skipIf(not HAS_TIMELIB, '\'timelib\' is not installed')
|
@skipIf(not HAS_TIMELIB, '\'timelib\' is not installed')
|
||||||
def test_date_format(self):
|
def test_date_format(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user