@@ -357,6 +357,126 @@ def test_project_create_property(self):
357357 self .assertEqual (self .columns , columns )
358358 self .assertEqual (self .datalist , data )
359359
360+ def test_project_create_is_domain_false_property (self ):
361+ arglist = [
362+ '--property' , 'is_domain=false' ,
363+ self .project .name ,
364+ ]
365+ verifylist = [
366+ ('parent' , None ),
367+ ('enable' , False ),
368+ ('disable' , False ),
369+ ('name' , self .project .name ),
370+ ('tags' , []),
371+ ('property' , {'is_domain' : 'false' }),
372+ ('name' , self .project .name ),
373+ ]
374+
375+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
376+
377+ # In base command class ShowOne in cliff, abstract method take_action()
378+ # returns a two-part tuple with a tuple of column names and a tuple of
379+ # data to be shown.
380+ columns , data = self .cmd .take_action (parsed_args )
381+
382+ # Set expected values
383+ kwargs = {
384+ 'name' : self .project .name ,
385+ 'domain' : None ,
386+ 'description' : None ,
387+ 'enabled' : True ,
388+ 'parent' : None ,
389+ 'is_domain' : False ,
390+ 'tags' : [],
391+ 'options' : {},
392+ }
393+ self .projects_mock .create .assert_called_with (
394+ ** kwargs
395+ )
396+
397+ self .assertEqual (self .columns , columns )
398+ self .assertEqual (self .datalist , data )
399+
400+ def test_project_create_is_domain_true_property (self ):
401+ arglist = [
402+ '--property' , 'is_domain=true' ,
403+ self .project .name ,
404+ ]
405+ verifylist = [
406+ ('parent' , None ),
407+ ('enable' , False ),
408+ ('disable' , False ),
409+ ('name' , self .project .name ),
410+ ('tags' , []),
411+ ('property' , {'is_domain' : 'true' }),
412+ ('name' , self .project .name ),
413+ ]
414+
415+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
416+
417+ # In base command class ShowOne in cliff, abstract method take_action()
418+ # returns a two-part tuple with a tuple of column names and a tuple of
419+ # data to be shown.
420+ columns , data = self .cmd .take_action (parsed_args )
421+
422+ # Set expected values
423+ kwargs = {
424+ 'name' : self .project .name ,
425+ 'domain' : None ,
426+ 'description' : None ,
427+ 'enabled' : True ,
428+ 'parent' : None ,
429+ 'is_domain' : True ,
430+ 'tags' : [],
431+ 'options' : {},
432+ }
433+ self .projects_mock .create .assert_called_with (
434+ ** kwargs
435+ )
436+
437+ self .assertEqual (self .columns , columns )
438+ self .assertEqual (self .datalist , data )
439+
440+ def test_project_create_is_domain_none_property (self ):
441+ arglist = [
442+ '--property' , 'is_domain=none' ,
443+ self .project .name ,
444+ ]
445+ verifylist = [
446+ ('parent' , None ),
447+ ('enable' , False ),
448+ ('disable' , False ),
449+ ('name' , self .project .name ),
450+ ('tags' , []),
451+ ('property' , {'is_domain' : 'none' }),
452+ ('name' , self .project .name ),
453+ ]
454+
455+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
456+
457+ # In base command class ShowOne in cliff, abstract method take_action()
458+ # returns a two-part tuple with a tuple of column names and a tuple of
459+ # data to be shown.
460+ columns , data = self .cmd .take_action (parsed_args )
461+
462+ # Set expected values
463+ kwargs = {
464+ 'name' : self .project .name ,
465+ 'domain' : None ,
466+ 'description' : None ,
467+ 'enabled' : True ,
468+ 'parent' : None ,
469+ 'is_domain' : None ,
470+ 'tags' : [],
471+ 'options' : {},
472+ }
473+ self .projects_mock .create .assert_called_with (
474+ ** kwargs
475+ )
476+
477+ self .assertEqual (self .columns , columns )
478+ self .assertEqual (self .datalist , data )
479+
360480 def test_project_create_parent (self ):
361481 self .parent = identity_fakes .FakeProject .create_one_project ()
362482 self .project = identity_fakes .FakeProject .create_one_project (
0 commit comments