@@ -1016,47 +1016,14 @@ class TestUnsetSubnetPool(TestSubnetPool):
10161016 def setUp (self ):
10171017 super (TestUnsetSubnetPool , self ).setUp ()
10181018 self ._subnetpool = network_fakes .FakeSubnetPool .create_one_subnet_pool (
1019- {'prefixes' : ['10.0.10.0/24' , '10.1.10.0/24' ,
1020- '10.2.10.0/24' ],
1021- 'tags' : ['green' , 'red' ]})
1019+ {'tags' : ['green' , 'red' ]})
10221020 self .network .find_subnet_pool = mock .Mock (
10231021 return_value = self ._subnetpool )
10241022 self .network .update_subnet_pool = mock .Mock (return_value = None )
10251023 self .network .set_tags = mock .Mock (return_value = None )
10261024 # Get the command object to test
10271025 self .cmd = subnet_pool .UnsetSubnetPool (self .app , self .namespace )
10281026
1029- def test_unset_subnet_pool (self ):
1030- arglist = [
1031- '--pool-prefix' , '10.0.10.0/24' ,
1032- '--pool-prefix' , '10.1.10.0/24' ,
1033- self ._subnetpool .name ,
1034- ]
1035- verifylist = [
1036- ('prefixes' , ['10.0.10.0/24' , '10.1.10.0/24' ]),
1037- ('subnet_pool' , self ._subnetpool .name ),
1038- ]
1039- parsed_args = self .check_parser (self .cmd , arglist , verifylist )
1040- result = self .cmd .take_action (parsed_args )
1041- attrs = {'prefixes' : ['10.2.10.0/24' ]}
1042- self .network .update_subnet_pool .assert_called_once_with (
1043- self ._subnetpool , ** attrs )
1044- self .assertIsNone (result )
1045-
1046- def test_unset_subnet_pool_prefix_not_existent (self ):
1047- arglist = [
1048- '--pool-prefix' , '10.100.1.1/25' ,
1049- self ._subnetpool .name ,
1050- ]
1051- verifylist = [
1052- ('prefixes' , ['10.100.1.1/25' ]),
1053- ('subnet_pool' , self ._subnetpool .name ),
1054- ]
1055- parsed_args = self .check_parser (self .cmd , arglist , verifylist )
1056- self .assertRaises (exceptions .CommandError ,
1057- self .cmd .take_action ,
1058- parsed_args )
1059-
10601027 def _test_unset_tags (self , with_tags = True ):
10611028 if with_tags :
10621029 arglist = ['--tag' , 'red' , '--tag' , 'blue' ]
0 commit comments