Module Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Num FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad orelse Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Dict Str BinOpMult BinOpAdd AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore NameLoad attr BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad NameLoad decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr ListLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str decorator_list
N/A N/A os N/A mock oslo_config cfg oslo_utils units nova exception nova objects nova.tests.unit fake_instance nova.tests.unit.objects test_flavor nova.tests.unit.virt.hyperv test_base nova.virt.hyperv constants nova.virt.hyperv imagecache N/A CONF N/A cfg CONF ImageCacheTestCase N/A N/A test_base HyperVBaseTestCase N/A N/A Unit tests for the Hyper-V ImageCache class. N/A FAKE_BASE_DIR fake/base/dir N/A FAKE_FORMAT fake_format N/A FAKE_IMAGE_REF fake_image_ref N/A FAKE_VHD_SIZE_GB 1 setUp N/A N/A self N/A N/A N/A N/A N/A N/A super ImageCacheTestCase self setUp N/A N/A self context fake-context N/A N/A self instance N/A N/A fake_instance fake_instance_obj N/A self context N/A patched_get_hostutils N/A N/A N/A mock patch object N/A imagecache utilsfactory get_hostutils N/A patched_get_vhdutils N/A N/A N/A mock patch object N/A imagecache utilsfactory get_vhdutils N/A N/A N/A patched_get_hostutils start N/A N/A N/A patched_get_vhdutils start N/A N/A N/A self addCleanup N/A patched_get_hostutils stop N/A N/A N/A self addCleanup N/A patched_get_vhdutils stop N/A N/A self imagecache N/A N/A imagecache ImageCache N/A N/A N/A self imagecache _pathutils N/A N/A mock MagicMock N/A N/A N/A self imagecache _vhdutils N/A N/A mock MagicMock N/A _test_get_root_vhd_size_gb N/A N/A self old_flavor N/A True N/A N/A old_flavor N/A N/A mock_flavor N/A N/A objects Flavor N/A test_flavor fake_flavor N/A N/A N/A self instance old_flavor mock_flavor N/A N/A N/A N/A self instance old_flavor None N/A N/A N/A N/A self imagecache _get_root_vhd_size_gb N/A self instance N/A test_get_root_vhd_size_gb_old_flavor N/A N/A self N/A N/A N/A ret_val N/A N/A self _test_get_root_vhd_size_gb N/A N/A N/A self assertEqual N/A N/A test_flavor fake_flavor N/A root_gb ret_val N/A test_get_root_vhd_size_gb N/A N/A self N/A N/A N/A ret_val N/A N/A self _test_get_root_vhd_size_gb old_flavor False N/A N/A N/A self assertEqual N/A N/A self instance root_gb ret_val N/A test_resize_and_cache_vhd_smaller N/A N/A self mock_get_vhd_size_gb N/A N/A N/A N/A N/A N/A N/A self imagecache _vhdutils get_vhd_size return_value N/A VirtualSize N/A N/A N/A self FAKE_VHD_SIZE_GB 1 N/A units Gi N/A N/A mock_get_vhd_size_gb return_value N/A self FAKE_VHD_SIZE_GB N/A mock_internal_vhd_size N/A N/A N/A self imagecache _vhdutils get_internal_vhd_size_by_file_size N/A N/A mock_internal_vhd_size return_value N/A N/A self FAKE_VHD_SIZE_GB N/A units Gi N/A N/A N/A self assertRaises N/A exception FlavorDiskSmallerThanImage N/A N/A self imagecache _resize_and_cache_vhd N/A N/A mock sentinel instance N/A N/A mock sentinel vhd_path N/A N/A N/A N/A N/A N/A self imagecache _vhdutils get_vhd_size assert_called_once_with N/A N/A mock sentinel vhd_path N/A N/A N/A mock_get_vhd_size_gb assert_called_once_with N/A N/A mock sentinel instance N/A N/A N/A mock_internal_vhd_size assert_called_once_with N/A N/A mock sentinel vhd_path N/A N/A self FAKE_VHD_SIZE_GB N/A units Gi N/A N/A N/A N/A mock patch object N/A imagecache ImageCache _get_root_vhd_size_gb _prepare_get_cached_image N/A N/A self path_exists use_cow N/A N/A N/A N/A N/A self instance image_ref N/A self FAKE_IMAGE_REF N/A N/A N/A N/A N/A self imagecache _pathutils get_base_vhd_dir return_value N/A self FAKE_BASE_DIR N/A N/A N/A N/A N/A self imagecache _pathutils exists return_value path_exists N/A N/A N/A N/A N/A self imagecache _vhdutils get_vhd_format return_value N/A constants DISK_FORMAT_VHD N/A N/A N/A CONF set_override use_cow_images use_cow N/A expected_path N/A N/A N/A os path join N/A self FAKE_BASE_DIR N/A self FAKE_IMAGE_REF N/A expected_vhd_path N/A %s.%s N/A expected_path N/A N/A N/A constants DISK_FORMAT_VHD lower N/A N/A expected_path expected_vhd_path N/A test_get_cached_image_with_fetch N/A N/A self mock_fetch N/A N/A N/A N/A expected_path expected_vhd_path N/A N/A self _prepare_get_cached_image False False N/A result N/A N/A N/A self imagecache get_cached_image N/A self context N/A self instance N/A N/A N/A self assertEqual expected_vhd_path result N/A N/A N/A mock_fetch assert_called_once_with N/A self context N/A self FAKE_IMAGE_REF expected_path N/A N/A self instance N/A user_id N/A N/A self instance N/A project_id N/A N/A N/A N/A N/A N/A self imagecache _vhdutils get_vhd_format assert_called_once_with expected_path N/A N/A N/A N/A N/A N/A self imagecache _pathutils rename assert_called_once_with expected_path expected_vhd_path N/A N/A N/A N/A mock patch object N/A imagecache images fetch test_get_cached_image_with_fetch_exception N/A N/A self mock_fetch N/A N/A N/A N/A expected_path expected_vhd_path N/A N/A self _prepare_get_cached_image False False N/A N/A N/A N/A N/A self imagecache _pathutils exists side_effect N/A False False True N/A N/A mock_fetch side_effect N/A N/A exception InvalidImageRef image_href N/A self FAKE_IMAGE_REF N/A N/A N/A self assertRaises N/A exception InvalidImageRef N/A N/A self imagecache get_cached_image N/A self context N/A self instance N/A N/A N/A N/A N/A N/A self imagecache _pathutils remove assert_called_once_with expected_path N/A N/A N/A N/A mock patch object N/A imagecache images fetch test_get_cached_image_use_cow N/A N/A self mock_resize N/A N/A N/A N/A expected_path expected_vhd_path N/A N/A self _prepare_get_cached_image True True N/A expected_resized_vhd_path N/A expected_vhd_path x N/A N/A mock_resize return_value expected_resized_vhd_path N/A result N/A N/A N/A self imagecache get_cached_image N/A self context N/A self instance N/A N/A N/A self assertEqual expected_resized_vhd_path result N/A N/A N/A mock_resize assert_called_once_with N/A self instance expected_vhd_path N/A N/A N/A N/A mock patch object N/A imagecache ImageCache _resize_and_cache_vhd N/A