#NEWLINE# @ patch ( 'changes.models.Repository.get_vcs' ) #NEWLINE# def test_when_in_whitelist_commit_build_false( self , get_vcs ) : #NEWLINE# #INDENT# po = ProjectOption ( project = self . project , name = 'build.file-whitelist' , value = 'nonexisting_directory' ) #NEWLINE# db . session . add ( po ) #NEWLINE# db . session . commit ( ) #NEWLINE# get_vcs . return_value = self . get_fake_vcs ( ) #NEWLINE# revision = self . create_revision ( repository = self . project . repository , sha = ( 'a' * 40 ) ) #NEWLINE# resp = self . client . post ( self . path , data = { #NEWLINE# #INDENT# 'sha' : ( 'a' * 40 ) , #NEWLINE# 'repository' : self . project . repository . url , #NEWLINE# 'apply_project_files_trigger' : '' , #NEWLINE# 'ensure_only' : '1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# data = self . unserialize ( resp ) #NEWLINE# assert ( len ( data ) == 1 ) #NEWLINE# assert data [ 0 ] [ 'id' ] #NEWLINE# job = Job . query . filter ( ( Job . build_id == data [ 0 ] [ 'id' ] ) ) . first ( ) #NEWLINE# build = job . build #NEWLINE# source = build . source #NEWLINE# assert ( job . project == self . project ) #NEWLINE# assert ( source . revision_sha == revision . sha )