]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Port test_nfs to Python 3
authorVictor Stinner <vstinner@redhat.com>
Tue, 18 Aug 2015 23:22:20 +0000 (16:22 -0700)
committerVictor Stinner <vstinner@redhat.com>
Wed, 19 Aug 2015 18:29:08 +0000 (11:29 -0700)
commit125fec94956faacb64453d020ae8c7d2143af130
treed3e6df371eb120288b92e95af1121d044ee27e15
parentc688a0af521e8679ac8f68d3dd035fe998e736d3
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
cinder/tests/unit/test_nfs.py
tox.ini