#NEWLINE# def test_find_master_dir( fake_master ) : #NEWLINE# #INDENT# '\n    parent\n        /master\n            /servi\n                \\servi_templates\n    ' #NEWLINE# ( master , nonmaster ) = fake_master #NEWLINE# assert ( find_master_dir ( 'master/servi/servi_templates' ) == master ) #NEWLINE# assert ( find_master_dir ( 'master/servi' ) == master ) #NEWLINE# assert ( find_master_dir ( 'master' ) == master ) #NEWLINE# with pytest . raises ( MasterNotFound ) : #NEWLINE# #INDENT# find_master_dir ( os . path . join ( master , '..' ) ) #NEWLINE# #UNINDENT# with pytest . raises ( MasterNotFound ) : #NEWLINE# #INDENT# find_master_dir ( nonmaster ) #NEWLINE# #UNINDENT# assert ( find_master_dir ( master , fail_ok = True ) is None ) #NEWLINE# with pytest . raises ( MasterNotFound ) : #NEWLINE# #INDENT# find_master_dir ( '/' ) #NEWLINE# #UNINDENT# print ( MasterNotFound ( ) )