code
stringlengths
3
6.57k
A.union(B)
print(A & B)
A.intersection(B)
print(A - B)
A.difference(B)
frozenset([1, 2, 3, 4])
frozenset([3, 4, 5, 6])
print(A.difference(B)
print(A | B)
print(A.add(3)
sys.path.insert(0, str(Path(__file__)
Copyright (c)
context.get_admin_context()
collections.namedtuple('Volume', vol_attrs)
huawei_utils.encode_name(ID)
huawei_utils.encode_name(ID)
json.dumps(FAKE_QUERY_ALL_LUN_RESPONSE)
json.dumps(FAKE_SNAPSHOT_LIST_INFO_RESPONSE)
json.dumps(FAKE_GET_METROROUP_RESPONSE)
FakeHuaweiConf(huawei_conf.HuaweiConf)
__init__(self, conf, protocol)
safe_get(self, key)
getattr(self.conf, key)
update_config_value(self)
setattr(self.conf, 'volume_backend_name', 'huawei_storage')
setattr(self.conf, 'san_user', 'admin')
setattr(self.conf, 'san_password', 'Admin@storage')
setattr(self.conf, 'san_product', 'V3')
setattr(self.conf, 'san_protocol', self.protocol)
setattr(self.conf, 'lun_type', constants.THICK_LUNTYPE)
setattr(self.conf, 'lun_ready_wait_interval', 2)
setattr(self.conf, 'lun_copy_wait_interval', 2)
setattr(self.conf, 'lun_timeout', 43200)
setattr(self.conf, 'lun_write_type', '1')
setattr(self.conf, 'lun_mirror_switch', '1')
setattr(self.conf, 'lun_prefetch_type', '1')
setattr(self.conf, 'lun_prefetch_value', '0')
setattr(self.conf, 'lun_policy', '0')
setattr(self.conf, 'lun_read_cache_policy', '2')
setattr(self.conf, 'lun_write_cache_policy', '5')
setattr(self.conf, 'storage_pools', ['OpenStack_Pool'])
setattr(self.conf, 'iscsi_default_target_ip', ['192.0.2.68'])
setattr(self.conf, 'metro_storage_pools', 'OpenStack_Pool')
setattr(self.conf, 'metro_san_user', 'admin')
setattr(self.conf, 'metro_san_password', 'Admin@storage1')
setattr(self.conf, 'metro_domain_name', 'hypermetro_test')
setattr(self.conf, 'iscsi_info', [iscsi_info])
setattr(self.conf, 'replication_device', targets)
setattr(self.conf, 'safe_get', self.safe_get)
FakeClient(rest_client.RestClient)
__init__(self, configuration)
_get_snapshotid_by_name(self, snapshot_name)
_check_snapshot_exist(self, snapshot_id)
get_partition_id_by_name(self, name)
get_cache_id_by_name(self, name)
add_lun_to_cache(self, lunid, cache_id)
url.replace('http://192.0.2.69:8082/deviceManager/rest', '')
url.replace('/210235G7J20000000000/', '')
json.dumps(data)
MAP_COMMAND_TO_FAKE_RESPONSE.keys()
json.loads(data)
FakeReplicaPairManager(replication.ReplicaPairManager)
_init_rmt_client(self)
FakeClient(self.conf)
FakeISCSIStorage(huawei_driver.HuaweiISCSIDriver)
__init__(self, configuration)
FakeHuaweiConf(self.configuration, 'iSCSI')
do_setup(self)
self.huawei_conf.update_config_value()
self.get_local_and_remote_dev_conf()
FakeClient(configuration=self.configuration)
FakeClient(configuration=self.configuration)
FakeClient(configuration=self.configuration)
FakeFCStorage(huawei_driver.HuaweiFCDriver)
__init__(self, configuration)
FakeHuaweiConf(self.configuration, 'iSCSI')
do_setup(self)
self.huawei_conf.update_config_value()
self.get_local_and_remote_dev_conf()
FakeClient(configuration=self.configuration)
FakeClient(configuration=self.configuration)
FakeClient(configuration=self.configuration)
HuaweiTestBase(test.TestCase)
setUp(self)
super(HuaweiTestBase, self)
setUp()
mock.Mock(spec=conf.Configuration)
FakeISCSIStorage(configuration=self.configuration)
self.driver.do_setup()
test_encode_name(self)
huawei_utils.encode_name(self.volume.id)
mock.patch.object(rest_client, 'RestClient')
test_create_snapshot_success(self, mock_client)
self.driver.create_snapshot(self.snapshot)
self.assertEqual(11, lun_info['provider_location'])
self.driver.create_snapshot(self.snapshot)
self.assertEqual(11, lun_info['provider_location'])
ddt.data('1', '', '0')
test_copy_volume(self, input_speed)
mock.Mock(wraps=self.driver.client.create_luncopy)