Remove remaining reference to the six library
This is follow-up of d86b063547
and
removes remaining reference to the six library in unit tests.
Change-Id: Ifd35da5b25e78bbc774a5a3caa40981d82a0820a
This commit is contained in:
parent
6de1ac30cb
commit
38ecd5db7c
|
@ -35,7 +35,7 @@ class TestBaseImageManager(testbase.TestCase):
|
|||
mock_open_context = mock.mock_open()
|
||||
mock_open_context().read.return_value = "YAML"
|
||||
|
||||
with mock.patch('six.moves.builtins.open', mock_open_context):
|
||||
with mock.patch('builtins.open', mock_open_context):
|
||||
base_manager = BaseImageManager(['yamlfile'])
|
||||
disk_images = base_manager.load_config_files('disk_images')
|
||||
|
||||
|
@ -82,7 +82,7 @@ class TestBaseImageManager(testbase.TestCase):
|
|||
mock_open_context = mock.mock_open()
|
||||
mock_open_context().read.return_value = "YAML"
|
||||
|
||||
with mock.patch('six.moves.builtins.open', mock_open_context):
|
||||
with mock.patch('builtins.open', mock_open_context):
|
||||
base_manager = BaseImageManager(['yamlfile1', 'yamlfile2'])
|
||||
disk_images = base_manager.load_config_files('disk_images')
|
||||
|
||||
|
@ -119,7 +119,7 @@ class TestBaseImageManager(testbase.TestCase):
|
|||
mock_open_context = mock.mock_open()
|
||||
mock_open_context().read.return_value = "YAML"
|
||||
|
||||
with mock.patch('six.moves.builtins.open', mock_open_context):
|
||||
with mock.patch('builtins.open', mock_open_context):
|
||||
base_manager = BaseImageManager(['yamlfile'])
|
||||
self.assertRaises(ImageSpecificationException,
|
||||
base_manager.load_config_files, 'disk_images')
|
||||
|
@ -151,7 +151,7 @@ class TestBaseImageManager(testbase.TestCase):
|
|||
mock_open_context = mock.mock_open()
|
||||
mock_open_context().read.return_value = "YAML"
|
||||
|
||||
with mock.patch('six.moves.builtins.open', mock_open_context):
|
||||
with mock.patch('builtins.open', mock_open_context):
|
||||
base_manager = BaseImageManager(['yamlfile1'],
|
||||
images=['not-overcloud'])
|
||||
disk_images = base_manager.load_config_files('disk_images')
|
||||
|
|
|
@ -129,7 +129,7 @@ class TestConfig(base.TestCase):
|
|||
|
||||
@patch.object(ooo_config.git, 'Repo')
|
||||
@mock.patch('os.mkdir')
|
||||
@mock.patch('six.moves.builtins.open')
|
||||
@mock.patch('builtins.open')
|
||||
@patch.object(ooo_config.shutil, 'rmtree')
|
||||
def test_overcloud_config_wrong_config_type(self, mock_rmtree,
|
||||
mock_open, mock_mkdir,
|
||||
|
|
Loading…
Reference in New Issue