API, batch: handle bad routes

This commit is contained in:
Carl Eberhard
2015-04-22 17:20:37 -04:00
parent 35b7c7788a
commit 5dcc4e8e3a
3 changed files with 58 additions and 29 deletions
+10 -1
View File
@@ -21,7 +21,6 @@ class ApiBatchTestCase( api.ApiTestCase ):
return post( "%s/batch" % ( self.galaxy_interactor.api_url ), data=data )
def test_simple_array( self ):
# post_body = dict( name='wert' )
batch = [
dict( url=self._with_key( '/api/histories' ) ),
dict( url=self._with_key( '/api/histories' ),
@@ -33,3 +32,13 @@ class ApiBatchTestCase( api.ApiTestCase ):
# log.debug( 'RESPONSE %s\n%s', ( '-' * 40 ), pprint.pformat( response ) )
self.assertIsInstance( response, list )
self.assertEquals( len( response ), 3 )
def test_bad_route( self ):
batch = [
dict( url=self._with_key( '/api/bler' ) )
]
response = self._post_batch( batch )
response = response.json()
# log.debug( 'RESPONSE %s\n%s', ( '-' * 40 ), pprint.pformat( response ) )
self.assertIsInstance( response, list )
self.assertEquals( response[0][ 'status' ], 404 )