Replaces __builtin__ with six.moves.builtins

__builtin__ does not exist in Python 3. Replacing it with
six.moves.builtins will ensure compatibility with both Python 2.7
and Python 3.4.

Partially implements blueprint: nova-python3-mitaka

Change-Id: If99c9670644f95e2b5c37d14fad491d829850f36
This commit is contained in:
Bo Wang 2016-01-13 11:27:11 +08:00
parent 4d7a594a1c
commit 2aac265d00

View File

@ -66,5 +66,6 @@ class TestUtilsTestCase(test.TestCase):
self.assertTrue(test_utils.is_ipv6_supported())
with fixtures.MonkeyPatch('sys.platform', 'linux2'):
with fixtures.MonkeyPatch('__builtin__.open', fake_open):
with fixtures.MonkeyPatch('six.moves.builtins.open',
fake_open):
self.assertFalse(test_utils.is_ipv6_supported())