#NEWLINE# @ mock . patch . object ( workbooks . WorkbookManager , 'validate' , mock . MagicMock ( return_value = { #NEWLINE# #INDENT# 'valid' : False , #NEWLINE# 'error' : "Invalid DSL: foobar\n\nEpic fail\nOn instance['tasks']['task1']:\n" , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# def test_workbook_invalid_syntax( self ) : #NEWLINE# #INDENT# def_yaml = self . _read_file_content ( WB_INVALID_SYNTAX_PATH ) #NEWLINE# result = self . validator . validate ( def_yaml ) #NEWLINE# expected = [ { #NEWLINE# #INDENT# 'type' : 'schema' , #NEWLINE# 'path' : 'tasks.task1' , #NEWLINE# 'message' : 'foobar' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertListEqual ( expected , result )