@@ -950,6 +950,49 @@ def test_quota_set_with_force(self):
950950 )
951951 self .assertIsNone (result )
952952
953+ def test_quota_set_with_check_limit (self ):
954+ arglist = [
955+ '--subnets' , str (network_fakes .QUOTA ['subnet' ]),
956+ '--volumes' , str (volume_fakes .QUOTA ['volumes' ]),
957+ '--cores' , str (compute_fakes .core_num ),
958+ '--check-limit' ,
959+ self .projects [0 ].name ,
960+ ]
961+ verifylist = [
962+ ('subnet' , network_fakes .QUOTA ['subnet' ]),
963+ ('volumes' , volume_fakes .QUOTA ['volumes' ]),
964+ ('cores' , compute_fakes .core_num ),
965+ ('check_limit' , True ),
966+ ('project' , self .projects [0 ].name ),
967+ ]
968+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
969+
970+ result = self .cmd .take_action (parsed_args )
971+
972+ kwargs_compute = {
973+ 'cores' : compute_fakes .core_num ,
974+ }
975+ kwargs_volume = {
976+ 'volumes' : volume_fakes .QUOTA ['volumes' ],
977+ }
978+ kwargs_network = {
979+ 'subnet' : network_fakes .QUOTA ['subnet' ],
980+ 'check_limit' : True ,
981+ }
982+ self .compute_quotas_mock .update .assert_called_once_with (
983+ self .projects [0 ].id ,
984+ ** kwargs_compute
985+ )
986+ self .volume_quotas_mock .update .assert_called_once_with (
987+ self .projects [0 ].id ,
988+ ** kwargs_volume
989+ )
990+ self .network_mock .update_quota .assert_called_once_with (
991+ self .projects [0 ].id ,
992+ ** kwargs_network
993+ )
994+ self .assertIsNone (result )
995+
953996
954997class TestQuotaShow (TestQuota ):
955998
0 commit comments