def test_update_policy_target_group_with_all_params(self): """policy-target-group-update.""" resource = 'policy_target_group' cmd = gbp.UpdatePolicyTargetGroup(test_cli20.MyApp(sys.stdout), None) my_id = 'my-id' name = 'ptg' description = 'ptg description' l2_policy_id = 'l2_policy_id' provided_prs = "icmp-prs=false,web-prs=true" consumed_prs = "ssh-prs=true,ftp-prs=false" network_service_policy_id = 'network_service_policy_id' shared = 'True' args = [ my_id, '--name', name, '--description', description, '--l2-policy-id', l2_policy_id, '--provided-policy-rule-sets', provided_prs, '--consumed-policy-rule-sets', consumed_prs, '--network-service-policy-id', network_service_policy_id, '--shared', shared ] provided_policy_rule_sets = {'icmp-prs': 'false', 'web-prs': 'true'} consumed_policy_rule_sets = {'ssh-prs': 'true', 'ftp-prs': 'false'} params = { 'name': name, 'description': description, 'l2_policy_id': l2_policy_id, 'provided_policy_rule_sets': provided_policy_rule_sets, 'consumed_policy_rule_sets': consumed_policy_rule_sets, 'network_service_policy_id': network_service_policy_id, 'shared': True } self._test_update_resource(resource, cmd, my_id, args, params)
def test_update_policy_target_group_action(self): """policy-policy-action-update.""" resource = 'policy_target_group' cmd = gbp.UpdatePolicyTargetGroup(test_cli20.MyApp(sys.stdout), None) self._test_update_resource(resource, cmd, 'myid', ['myid', '--name', 'myname', '--tags', 'a', 'b'], {'name': 'myname', 'tags': ['a', 'b'], })
def test_update_policy_target_group_unset_nsp(self): """policy-target-group-update.""" resource = 'policy_target_group' cmd = gbp.UpdatePolicyTargetGroup(test_cli20.MyApp(sys.stdout), None) my_id = 'my-id' network_service_policy_id = '' args = [my_id, '--network-service-policy', network_service_policy_id] params = {'network_service_policy_id': None} self._test_update_resource(resource, cmd, my_id, args, params)
def test_update_policy_target_group_unset_apg(self): """policy-target-group-update.""" resource = 'policy_target_group' cmd = gbp.UpdatePolicyTargetGroup(test_cli20.MyApp(sys.stdout), None) my_id = 'my-id' application_policy_group_id = '' args = [ my_id, '--application-policy-group', application_policy_group_id ] params = {'application_policy_group_id': None} self._test_update_resource(resource, cmd, my_id, args, params)
def test_update_policy_target_group_unset_prs(self): """policy-target-group-update.""" resource = 'policy_target_group' cmd = gbp.UpdatePolicyTargetGroup(test_cli20.MyApp(sys.stdout), None) my_id = 'my-id' provided_prs = "" consumed_prs = "" args = [my_id, '--provided-policy-rule-sets', provided_prs, '--consumed-policy-rule-sets', consumed_prs ] params = { 'provided_policy_rule_sets': {}, 'consumed_policy_rule_sets': {} } self._test_update_resource(resource, cmd, my_id, args, params)