@@ -65,7 +65,7 @@ def setUp(self):
6565 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
6666 self .assertEqual (response .status_code , 200 )
6767
68- def test_container_scale (self ):
68+ def test_container (self ):
6969 url = '/api/apps'
7070 body = {'formation' : 'autotest' }
7171 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
@@ -89,6 +89,16 @@ def test_container_scale(self):
8989 response = self .client .get (url )
9090 self .assertEqual (response .status_code , 200 )
9191 self .assertEqual (response .data ['containers' ], json .dumps (body ))
92+ # test listing/retrieving container info
93+ url = "/api/apps/{app_id}/containers/web" .format (** locals ())
94+ response = self .client .get (url )
95+ self .assertEqual (response .status_code , 200 )
96+ self .assertEqual (len (response .data ['results' ]), 4 )
97+ num = response .data ['results' ][0 ]['num' ]
98+ url = "/api/apps/{app_id}/containers/web/{num}" .format (** locals ())
99+ response = self .client .get (url )
100+ self .assertEqual (response .status_code , 200 )
101+ self .assertEqual (response .data ['num' ], num )
92102 # scale down
93103 url = "/api/apps/{app_id}/scale" .format (** locals ())
94104 body = {'web' : 2 , 'worker' : 1 }
@@ -115,7 +125,7 @@ def test_container_scale(self):
115125 self .assertEqual (response .status_code , 200 )
116126 self .assertEqual (response .data ['containers' ], json .dumps (body ))
117127
118- def test_container_scale_errors (self ):
128+ def test_container_errors (self ):
119129 url = '/api/apps'
120130 body = {'formation' : 'autotest' }
121131 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
@@ -126,7 +136,7 @@ def test_container_scale_errors(self):
126136 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
127137 self .assertContains (response , 'Invalid scaling format' , status_code = 400 )
128138
129- def test_container_scale_single_layer (self ):
139+ def test_container_single_layer (self ):
130140 # create & scale a single layer formation
131141 response = self .client .post ('/api/formations' , json .dumps (
132142 {'id' : 'single-layer' , 'domain' : 'localhost.localdomain' }),
@@ -191,7 +201,7 @@ def test_container_scale_single_layer(self):
191201 self .assertEqual (response .status_code , 200 )
192202 self .assertEqual (response .data ['containers' ], json .dumps (body ))
193203
194- def test_container_scale_allocation (self ):
204+ def test_container_allocation (self ):
195205 url = '/api/apps'
196206 formation_id = 'autotest'
197207 body = {'formation' : formation_id }
0 commit comments