@@ -361,12 +361,34 @@ def test_build_image_in_registry_with_auth(self, mock_requests):
361361 response = self .client .post (url , {'image' : image })
362362 self .assertEqual (response .status_code , 201 , response .data )
363363
364+ # add the required PORT information
365+ url = '/v2/apps/test/config'
366+ body = {'values' : json .dumps ({'PORT' : '80' })}
367+ response = self .client .post (url , body )
368+ self .assertEqual (response .status_code , 201 , response .data )
369+
364370 # set some registry information
365371 url = '/v2/apps/test/config'
366372 body = {'registry' : json .dumps ({'username' : 'bob' , 'password' : 'zoomzoom' })}
367373 response = self .client .post (url , body )
368374 self .assertEqual (response .status_code , 201 , response .data )
369375
376+ def test_build_image_in_registry_with_auth_no_port (self , mock_requests ):
377+ """add authentication to the build but with no PORT config"""
378+ self .client .post ('/v2/apps' , {'id' : 'test' })
379+
380+ # post an image as a build using registry hostname
381+ url = "/v2/apps/test/builds"
382+ image = 'autotest/example'
383+ response = self .client .post (url , {'image' : image })
384+ self .assertEqual (response .status_code , 201 , response .data )
385+
386+ # set some registry information
387+ url = '/v2/apps/test/config'
388+ body = {'registry' : json .dumps ({'username' : 'bob' , 'password' : 'zoomzoom' })}
389+ response = self .client .post (url , body )
390+ self .assertEqual (response .status_code , 400 , response .data )
391+
370392 def test_release_create_failure (self , mock_requests ):
371393 """
372394 Cause an Exception in app.deploy to cause a release.delete in build.create
0 commit comments