#NEWLINE# @ mock . patch . object ( workbooks . WorkbookManager , 'validate' , mock . MagicMock ( return_value = { #NEWLINE# #INDENT# 'valid' : False , #NEWLINE# 'error' : "Invalid DSL: 'version' is a required property\n" , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# def test_missing_version( self ) : #NEWLINE# #INDENT# def_dict = self . _read_yaml_file_as_json ( WB_PRE_XFORM_PATH ) #NEWLINE# del result [ 'version' ] #NEWLINE# def_yaml = yaml . safe_dump ( def_dict ) #NEWLINE# result = self . validator . validate ( def_yaml ) #NEWLINE# expected = [ { #NEWLINE# #INDENT# 'type' : 'schema' , #NEWLINE# 'path' : None , #NEWLINE# 'message' : "'version' is a required property" , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertListEqual ( expected , result )