@@ -211,6 +211,35 @@ def test_create_with_ha_option(self):
211211 def test_create_with_no_ha_option (self ):
212212 self ._test_create_with_ha_options ('--no-ha' , False )
213213
214+ def _test_create_with_distributed_options (self , option , distributed ):
215+ arglist = [
216+ option ,
217+ self .new_router .name ,
218+ ]
219+ verifylist = [
220+ ('name' , self .new_router .name ),
221+ ('enable' , True ),
222+ ('distributed' , distributed ),
223+ ('centralized' , not distributed ),
224+ ]
225+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
226+
227+ columns , data = (self .cmd .take_action (parsed_args ))
228+
229+ self .network .create_router .assert_called_once_with (** {
230+ 'admin_state_up' : True ,
231+ 'name' : self .new_router .name ,
232+ 'distributed' : distributed ,
233+ })
234+ self .assertEqual (self .columns , columns )
235+ self .assertEqual (self .data , data )
236+
237+ def test_create_with_distributed_option (self ):
238+ self ._test_create_with_distributed_options ('--distributed' , True )
239+
240+ def test_create_with_centralized_option (self ):
241+ self ._test_create_with_distributed_options ('--centralized' , False )
242+
214243 def test_create_with_AZ_hints (self ):
215244 arglist = [
216245 self .new_router .name ,
0 commit comments