@@ -122,6 +122,29 @@ def test_build_default_containers(self, mock_requests):
122122 # pod name is auto generated so use regex
123123 self .assertRegex (container ['name' ], app_id + '-cmd-[0-9]{8,10}-[a-z0-9]{5}' )
124124
125+ # post an image as a build with a procfile
126+ app_id = self .create_app ()
127+ # post an image as a build
128+ url = "/v2/apps/{app_id}/builds" .format (** locals ())
129+ body = {
130+ 'image' : 'autotest/example' ,
131+ 'procfile' : {
132+ 'web' : 'node worker.js'
133+ }
134+ }
135+ response = self .client .post (url , body )
136+ self .assertEqual (response .status_code , 201 , response .data )
137+
138+ url = "/v2/apps/{app_id}/pods/web" .format (** locals ())
139+ response = self .client .get (url )
140+ self .assertEqual (response .status_code , 200 , response .data )
141+ self .assertEqual (len (response .data ['results' ]), 1 )
142+ container = response .data ['results' ][0 ]
143+ self .assertEqual (container ['type' ], 'web' )
144+ self .assertEqual (container ['release' ], 'v2' )
145+ # pod name is auto generated so use regex
146+ self .assertRegex (container ['name' ], app_id + '-web-[0-9]{8,10}-[a-z0-9]{5}' )
147+
125148 # start with a new app
126149 app_id = self .create_app ()
127150 # post a new build with procfile
0 commit comments