Port test_nfs to Python 3
testtools.ExpectedException(exc_class, regex) expects the exact exc_class class, wheras the test_setup_should_throw_exception_if_mount_nfs_command_fails() test raises a PermissionError on Python 3.3+ instead of OSError. Replace testtools.ExpectedException() with self.assertRaisesRegex() to port the test to Python 3, this method accepts subclasses of exc_class. Replace also testtools.ExpectedException() with self.assertRaisesRegex() in other tests. Blueprint https://blueprints.launchpad.net/cinder/+spec/cinder-python3 Change-Id: If5a74529e5ac68a2118afa8ecfd86bf24307b0b7
This commit is contained in:
Reference in New Issue
Block a user