@@ -35,11 +35,7 @@ def setUp(self):
3535 'protocol' : 'fake_protocol' ,
3636 'type' : 'fake_type' }}
3737 methods = {
38- 'get_vnc_console' : fake_console_data ,
39- 'get_spice_console' : fake_console_data ,
40- 'get_serial_console' : fake_console_data ,
41- 'get_rdp_console' : fake_console_data ,
42- 'get_mks_console' : fake_console_data ,
38+ 'get_console_url' : fake_console_data
4339 }
4440 self .fake_server = compute_fakes .FakeServer .create_one_server (
4541 methods = methods )
@@ -68,7 +64,7 @@ def test_console_url_show_by_default(self):
6864 ]
6965 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
7066 columns , data = self .cmd .take_action (parsed_args )
71- self .fake_server .get_vnc_console .assert_called_once_with ('novnc' )
67+ self .fake_server .get_console_url .assert_called_once_with ('novnc' )
7268 self .assertEqual (self .columns , columns )
7369 self .assertEqual (self .data , data )
7470
@@ -83,7 +79,7 @@ def test_console_url_show_with_novnc(self):
8379 ]
8480 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
8581 columns , data = self .cmd .take_action (parsed_args )
86- self .fake_server .get_vnc_console .assert_called_once_with ('novnc' )
82+ self .fake_server .get_console_url .assert_called_once_with ('novnc' )
8783 self .assertEqual (self .columns , columns )
8884 self .assertEqual (self .data , data )
8985
@@ -98,7 +94,7 @@ def test_console_url_show_with_xvpvnc(self):
9894 ]
9995 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
10096 columns , data = self .cmd .take_action (parsed_args )
101- self .fake_server .get_vnc_console .assert_called_once_with ('xvpvnc' )
97+ self .fake_server .get_console_url .assert_called_once_with ('xvpvnc' )
10298 self .assertEqual (self .columns , columns )
10399 self .assertEqual (self .data , data )
104100
@@ -113,14 +109,14 @@ def test_console_url_show_with_spice(self):
113109 ]
114110 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
115111 columns , data = self .cmd .take_action (parsed_args )
116- self .fake_server .get_spice_console .assert_called_once_with (
112+ self .fake_server .get_console_url .assert_called_once_with (
117113 'spice-html5' )
118114 self .assertEqual (self .columns , columns )
119115 self .assertEqual (self .data , data )
120116
121117 def test_console_url_show_compatible (self ):
122118 methods = {
123- 'get_vnc_console ' : {'console' : {'url' : 'http://localhost' ,
119+ 'get_console_url ' : {'console' : {'url' : 'http://localhost' ,
124120 'type' : 'fake_type' }},
125121 }
126122 old_fake_server = compute_fakes .FakeServer .create_one_server (
@@ -130,8 +126,8 @@ def test_console_url_show_compatible(self):
130126 'url' ,
131127 )
132128 old_data = (
133- methods ['get_vnc_console ' ]['console' ]['type' ],
134- methods ['get_vnc_console ' ]['console' ]['url' ]
129+ methods ['get_console_url ' ]['console' ]['type' ],
130+ methods ['get_console_url ' ]['console' ]['url' ]
135131 )
136132 arglist = [
137133 'foo_vm' ,
@@ -144,7 +140,7 @@ def test_console_url_show_compatible(self):
144140 with mock .patch .object (self .servers_mock , 'get' ,
145141 return_value = old_fake_server ):
146142 columns , data = self .cmd .take_action (parsed_args )
147- old_fake_server .get_vnc_console .assert_called_once_with ('novnc' )
143+ old_fake_server .get_console_url .assert_called_once_with ('novnc' )
148144 self .assertEqual (old_columns , columns )
149145 self .assertEqual (old_data , data )
150146
@@ -159,7 +155,7 @@ def test_console_url_show_with_rdp(self):
159155 ]
160156 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
161157 columns , data = self .cmd .take_action (parsed_args )
162- self .fake_server .get_rdp_console .assert_called_once_with (
158+ self .fake_server .get_console_url .assert_called_once_with (
163159 'rdp-html5' )
164160 self .assertEqual (self .columns , columns )
165161 self .assertEqual (self .data , data )
@@ -175,7 +171,7 @@ def test_console_url_show_with_serial(self):
175171 ]
176172 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
177173 columns , data = self .cmd .take_action (parsed_args )
178- self .fake_server .get_serial_console .assert_called_once_with (
174+ self .fake_server .get_console_url .assert_called_once_with (
179175 'serial' )
180176 self .assertEqual (self .columns , columns )
181177 self .assertEqual (self .data , data )
@@ -191,6 +187,6 @@ def test_console_url_show_with_mks(self):
191187 ]
192188 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
193189 columns , data = self .cmd .take_action (parsed_args )
194- self .fake_server .get_mks_console .assert_called_once_with ()
190+ self .fake_server .get_console_url .assert_called_once_with ('webmks' )
195191 self .assertEqual (self .columns , columns )
196192 self .assertEqual (self .data , data )
0 commit comments