

def test_show_hosting_device(self):
    device_id = 'device_XYZ'
    with self.hosting_device_template() as hdt:
        with self.port(subnet=self._mgmt_subnet) as mgmt_port:
            creds = device_manager_test_support._uuid()
            attrs = self._get_test_hosting_device_attr(device_id=device_id, template_id=hdt['hosting_device_template']['id'], management_port_id=mgmt_port['port']['id'], credentials_id=creds)
            with self.hosting_device(device_id=device_id, template_id=hdt['hosting_device_template']['id'], management_port_id=mgmt_port['port']['id'], credentials_id=creds) as hd:
                req = self.new_show_request('hosting_devices', hd['hosting_device']['id'], fmt=self.fmt)
                res = self.deserialize(self.fmt, req.get_response(self.ext_api))
                for (k, v) in six.iteritems(attrs):
                    self.assertEqual(v, res['hosting_device'][k])

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_db_device_manager.py TestDeviceManagerDBPlugin.test_show_hosting_device/original