def setUp(self):
        super(TestConsoleUrlShow, self).setUp()
        fake_console_data = {
            'remote_console': {
                'url': 'http://localhost',
                'protocol': 'fake_protocol',
                'type': 'fake_type'
            }
        }
        methods = {
            'get_vnc_console': fake_console_data,
            'get_spice_console': fake_console_data,
            'get_serial_console': fake_console_data,
            'get_rdp_console': fake_console_data,
            'get_mks_console': fake_console_data,
        }
        self.fake_server = compute_fakes.FakeServer.create_one_server(
            methods=methods)
        self.servers_mock.get.return_value = self.fake_server

        self.columns = (
            'protocol',
            'type',
            'url',
        )
        self.data = (fake_console_data['remote_console']['protocol'],
                     fake_console_data['remote_console']['type'],
                     fake_console_data['remote_console']['url'])

        self.cmd = console.ShowConsoleURL(self.app, None)
Exemplo n.º 2
0
    def setUp(self):
        super(TestConsoleUrlShow, self).setUp()
        self.sdk_client.find_server.return_value = self._server
        fake_console_data = {'url': 'http://localhost',
                             'protocol': 'fake_protocol',
                             'type': 'fake_type'}
        self.sdk_client.create_console = mock.Mock(
            return_value=fake_console_data)

        self.columns = (
            'protocol',
            'type',
            'url',
        )
        self.data = (
            fake_console_data['protocol'],
            fake_console_data['type'],
            fake_console_data['url']
        )

        self.cmd = console.ShowConsoleURL(self.app, None)