@@ -94,7 +94,7 @@ def teardown():
9494 return service_s , test_service
9595
9696
97- def curdle_check (collection , resource , resource_name , ** kwargs ):
97+ def curdle_check2 (collection , resource , resource_name , ** kwargs ):
9898 name = kwargs ['name' ]
9999 assert resource .name == name
100100 second_resource = getattr (collection , resource_name ).load (** kwargs )
@@ -110,6 +110,10 @@ def curdle_check(collection, resource, resource_name, **kwargs):
110110 second_resource .refresh ()
111111 assert second_resource .generation == resource .generation
112112
113+
114+ def curdle_check (collection , resource , resource_name , ** kwargs ):
115+ curdle_check2 (collection , resource , resource_name , ** kwargs )
116+
113117 assert getattr (collection , resource_name ).exists (** kwargs ) is True
114118
115119
@@ -119,6 +123,48 @@ def test_get_collection(self, request, bigip):
119123 app_org_full_s = app_org_s .get_collection ()
120124 assert len (app_org_full_s ) == 4
121125
126+ def test_disallowed_params (self , request , bigip ):
127+ """Tests that a disallowed parameter is removed
128+
129+ This check does not test for failure. Instead, the code in the
130+ associated class will pop the disallowed parameter off of the
131+ kwargs.
132+
133+ Then, the kwargs will be sent through the check_load_parameters,
134+ which checks for "name" and "partition".
135+
136+ Finally, the code will issue a GET request to BIG-IP. If this
137+ method fails, then our disallowed parameter was not removed
138+ properly.
139+
140+ :param mgmt_root:
141+ :return:
142+ """
143+ serv_s , test_serv = setup_service_test (
144+ request ,
145+ bigip ,
146+ 'test_service2' ,
147+ 'Common' ,
148+ 'test_template2' ,
149+ '/Common/traffic-group-local-only'
150+ )
151+ # Make sure the uri is what we expect
152+ uri = '' .join ([
153+ bigip ._meta_data ['uri' ],
154+ 'sys/application/service/~Common' ,
155+ '~test_service2.app~test_service2' ])
156+ assert uri in test_serv ._meta_data ['uri' ]
157+
158+ curdle_check2 (
159+ serv_s ,
160+ test_serv ,
161+ 'service' ,
162+ name = 'test_service2' ,
163+ partition = 'Common' ,
164+ template = "bar" ,
165+ trafficGroup = "foo"
166+ )
167+
122168
123169class TestTemplateCollection (object ):
124170 def test_get_collection (self , request , bigip ):
0 commit comments