#NEWLINE# def test_simple( self ) : #NEWLINE# #INDENT# resp = self . client . put ( self . path , data = { #NEWLINE# #INDENT# 'name' : 'foobar' , #NEWLINE# 'provider' : 'shell' , #NEWLINE# 'provider_config' : '{"command": "/usr/bin/true", "timeout": 50}' , #NEWLINE# 'notifiers' : '[{"type": "slack", "config": {"webhook_url": "https://example.com"}}]' , #NEWLINE# 'checks' : '[{"type": "github", "config": {"contexts": ["travisci"], "repo": "getsentry/freight"}}]' , #NEWLINE# 'repository' : 'git@example.com:repo-name.git' , #NEWLINE# 'environments' : '{"staging": {"default_ref": "develop"}}' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# data = json . loads ( resp . data ) #NEWLINE# assert ( data [ 'id' ] == str ( self . app . id ) ) #NEWLINE# app = App . query . get ( self . app . id ) #NEWLINE# deploy_config = app . deploy_config #NEWLINE# assert ( app . name == 'foobar' ) #NEWLINE# assert ( deploy_config . provider == 'shell' ) #NEWLINE# assert ( deploy_config . provider_config [ 'command' ] == '/usr/bin/true' ) #NEWLINE# assert ( deploy_config . provider_config [ 'timeout' ] == 50 ) #NEWLINE# assert ( deploy_config . notifiers == [ { #NEWLINE# #INDENT# 'type' : 'slack' , #NEWLINE# 'config' : { #NEWLINE# #INDENT# 'webhook_url' : 'https://example.com' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# assert ( len ( deploy_config . checks ) == 1 ) #NEWLINE# assert ( deploy_config . checks [ 0 ] [ 'type' ] == 'github' ) #NEWLINE# assert ( deploy_config . checks [ 0 ] [ 'config' ] == { #NEWLINE# #INDENT# 'contexts' : [ 'travisci' ] , #NEWLINE# 'repo' : 'getsentry/freight' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( len ( app . environments ) == 1 ) #NEWLINE# assert ( app . environments [ 'staging' ] == { #NEWLINE# #INDENT# 'default_ref' : 'develop' , #NEWLINE# #UNINDENT# } )