def test_translate_volume_keys(self): cs = fakes.FakeClient() v = cs.volumes.list()[0] setattr(v, 'os-vol-tenant-attr:tenant_id', 'fake_tenant') setattr(v, '_info', {'attachments': [{'server_id': 1234}], 'id': 1234, 'display_name': 'sample-volume', 'os-vol-tenant-attr:tenant_id': 'fake_tenant'}) shell_v1._translate_volume_keys([v]) self.assertEqual('fake_tenant', v.tenant_id)
def test_translate_volume_keys(self): cs = fakes.FakeClient() v = cs.volumes.list()[0] setattr(v, 'os-vol-tenant-attr:tenant_id', 'fake_tenant') setattr(v, '_info', {'attachments': [{'server_id': 1234}], 'id': 1234, 'display_name': 'sample-volume', 'os-vol-tenant-attr:tenant_id': 'fake_tenant'}) shell_v1._translate_volume_keys([v]) self.assertEqual(v.tenant_id, 'fake_tenant')
def test_translate_volume_keys(self): cs = fakes.FakeClient() v = cs.volumes.list()[0] setattr(v, "os-vol-tenant-attr:tenant_id", "fake_tenant") setattr( v, "_info", { "attachments": [{"server_id": 1234}], "id": 1234, "name": "sample-volume", "os-vol-tenant-attr:tenant_id": "fake_tenant", }, ) shell_v1._translate_volume_keys([v]) self.assertEqual(v.tenant_id, "fake_tenant")