#NEWLINE# def test_container_scale_errors( self ) : #NEWLINE# #INDENT# url = '/v1/apps' #NEWLINE# response = self . client . post ( url , HTTP_AUTHORIZATION = 'token {}' . format ( url . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 201 ) #NEWLINE# app_id = response . data [ 'id' ] #NEWLINE# url = '/v1/apps/{app_id}/containers' . format ( ** locals ( ) ) #NEWLINE# response = self . client . get ( url , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( len ( response . data [ 'results' ] ) , 0 ) #NEWLINE# url = '/v1/apps/{app_id}/builds' . format ( ** locals ( ) ) #NEWLINE# body = { #NEWLINE# #INDENT# 'image' : 'autotest/example' , #NEWLINE# 'sha' : ( 'a' * 40 ) , #NEWLINE# 'procfile' : json . dumps ( { #NEWLINE# #INDENT# 'web' : 'node server.js' , #NEWLINE# 'worker' : 'node worker.js' , #NEWLINE# #UNINDENT# } ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 201 ) #NEWLINE# url = '/v1/apps/{app_id}/scale' . format ( ** locals ( ) ) #NEWLINE# body = { #NEWLINE# #INDENT# 'web' : ( - 1 ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 400 ) #NEWLINE# url = '/v1/apps/{app_id}/scale' . format ( ** locals ( ) ) #NEWLINE# body = { #NEWLINE# #INDENT# 'web' : 'one' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 400 ) #NEWLINE# url = '/v1/apps/{app_id}/scale' . format ( ** locals ( ) ) #NEWLINE# body = { #NEWLINE# #INDENT# 'web' : [ 1 ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 400 ) #NEWLINE# url = '/v1/apps/{app_id}/scale' . format ( ** locals ( ) ) #NEWLINE# body = { #NEWLINE# #INDENT# 'web' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 204 )