|
|
|
@ -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') |
|
|
|
|