@@ -1446,6 +1446,8 @@ def test_server_create_with_options(self):
14461446 'a=b' ,
14471447 '--hint' ,
14481448 'a=c' ,
1449+ '--server-group' ,
1450+ 'servergroup' ,
14491451 self .new_server .name ,
14501452 ]
14511453 verifylist = [
@@ -1454,22 +1456,26 @@ def test_server_create_with_options(self):
14541456 ('key_name' , 'keyname' ),
14551457 ('properties' , {'Beta' : 'b' }),
14561458 ('security_group' , ['securitygroup' ]),
1457- ('hint' , {'a' : ['b' , 'c' ]}),
1459+ ('hints' , {'a' : ['b' , 'c' ]}),
1460+ ('server_group' , 'servergroup' ),
14581461 ('config_drive' , True ),
14591462 ('password' , 'passw0rd' ),
14601463 ('server_name' , self .new_server .name ),
14611464 ]
14621465 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
14631466
1464- # In base command class ShowOne in cliff, abstract method take_action ()
1465- # returns a two-part tuple with a tuple of column names and a tuple of
1466- # data to be shown.
1467+ fake_server_group = compute_fakes . create_one_server_group ()
1468+ self . compute_client . server_groups . get . return_value = fake_server_group
1469+
14671470 fake_sg = network_fakes .FakeSecurityGroup .create_security_groups ()
14681471 mock_find_sg = network_fakes .FakeSecurityGroup .get_security_groups (
14691472 fake_sg
14701473 )
14711474 self .app .client_manager .network .find_security_group = mock_find_sg
14721475
1476+ # In base command class ShowOne in cliff, abstract method take_action()
1477+ # returns a two-part tuple with a tuple of column names and a tuple of
1478+ # data to be shown.
14731479 columns , data = self .cmd .take_action (parsed_args )
14741480
14751481 mock_find_sg .assert_called_once_with (
@@ -1489,7 +1495,7 @@ def test_server_create_with_options(self):
14891495 admin_pass = 'passw0rd' ,
14901496 block_device_mapping_v2 = [],
14911497 nics = [],
1492- scheduler_hints = {'a' : ['b' , 'c' ]},
1498+ scheduler_hints = {'a' : ['b' , 'c' ], 'group' : fake_server_group . id },
14931499 config_drive = True ,
14941500 )
14951501 # ServerManager.create(name, image, flavor, **kwargs)
0 commit comments