@@ -349,3 +349,27 @@ def test_release_unset_config(self, mock_requests):
349349 body = {'cpu' : json .dumps ({'cmd' : None })}
350350 response = self .client .post (url , body )
351351 self .assertEqual (response .status_code , 422 , response .data )
352+
353+ def test_release_no_change (self , mock_requests ):
354+ """
355+ Test that a release is created when an app is created, and
356+ then has 2 identical config set, causing a 409 as there was
357+ no change
358+ """
359+ url = '/v2/apps'
360+ response = self .client .post (url )
361+ self .assertEqual (response .status_code , 201 , response .data )
362+ app_id = response .data ['id' ]
363+
364+ # check that updating config rolls a new release
365+ url = '/v2/apps/{app_id}/config' .format (** locals ())
366+ body = {'values' : json .dumps ({'NEW_URL1' : 'http://localhost:8080/' })}
367+ response = self .client .post (url , body )
368+ self .assertEqual (response .status_code , 201 , response .data )
369+ self .assertIn ('NEW_URL1' , response .data ['values' ])
370+
371+ # trigger identical release
372+ url = '/v2/apps/{app_id}/config' .format (** locals ())
373+ body = {'values' : json .dumps ({'NEW_URL1' : 'http://localhost:8080/' })}
374+ response = self .client .post (url , body )
375+ self .assertEqual (response .status_code , 409 , response .data )
0 commit comments