#NEWLINE# def test_cases( ) : #NEWLINE# #INDENT# from copy import deepcopy #NEWLINE# g = rdflib . Graph ( ) #NEWLINE# swap_dir = os . path . join ( os . getcwd ( ) , 'test' , 'swap-n3' ) #NEWLINE# g . parse ( os . path . join ( swap_dir , 'n3-rdf.tests' ) , format = 'n3' ) #NEWLINE# g . parse ( os . path . join ( swap_dir , 'n3-full.tests' ) , format = 'n3' ) #NEWLINE# tfiles = [ ] #NEWLINE# swap_dir_uri = ( dir_to_uri ( swap_dir ) + '/' ) #NEWLINE# for tst in g . subjects ( ) : #NEWLINE# #INDENT# files = [ str ( tfile ) . replace ( 'http://www.w3.org/2000/10/' , swap_dir_uri ) for tfile in g . objects ( tst , rdflib . URIRef ( 'http://www.w3.org/2004/11/n3test#inputDocument' ) ) if tfile . endswith ( 'n3' ) ] #NEWLINE# tfiles += files #NEWLINE# #UNINDENT# for tfile in set ( tfiles ) : #NEWLINE# #INDENT# gname = tfile . split ( '/swap-n3/swap/test/' ) [ 1 ] [ : ( - 3 ) ] . translate ( maketrans ( '-/' , '__' ) ) #NEWLINE# e = Envelope ( gname , gjt ) #NEWLINE# if ( gname in skiptests ) : #NEWLINE# #INDENT# e . skip = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# e . skip = False #NEWLINE# #UNINDENT# if ( sys . version_info [ : 2 ] == ( 2 , 4 ) ) : #NEWLINE# #INDENT# import pickle #NEWLINE# gjt = pickle . dumps ( generictest ) #NEWLINE# gt = pickle . loads ( gjt ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# gt = deepcopy ( generictest ) #NEWLINE# #UNINDENT# gt . __doc__ = tfile #NEWLINE# ( yield ( gt , e ) )