@@ -234,7 +234,7 @@ def test_validate_dataset(self):
234234 self .assertEqual (["Scales must be strictly monotonic increasing" ], errors )
235235
236236 def test_dsres_load_all (self ):
237- path , _ = os .path .split (__file__ )
237+ path , _ = os .path .split (sdf . __file__ )
238238 filename = os .path .join (path , 'examples' , 'IntegerNetwork1.mat' )
239239
240240 g = sdf .load (filename )
@@ -266,7 +266,7 @@ def test_dsres_load_all(self):
266266
267267 def test_dsres_load_dataset (self ):
268268
269- path , _ = os .path .split (__file__ )
269+ path , _ = os .path .split (sdf . __file__ )
270270 filename = os .path .join (path , 'examples' , 'IntegerNetwork1.mat' )
271271
272272 ds = sdf .load (filename , objectname = '/booleanPulse2/period' )
@@ -292,30 +292,17 @@ def test_dsres_load_dataset(self):
292292 self .assertEqual (ds .data .dtype , np .int32 )
293293 self .assertEqual (ds .data , 1 )
294294
295- # def test_excel2sdf_example(self):
296- # path, _ = os.path.split(__file__)
297- # filename = os.path.join(path, 'examples', 'excel2sdf.py')
298- # runpy.run_path(filename)
299-
300295 def test_interp_1d_example (self ):
301- path , _ = os .path .split (__file__ )
302- filename = os .path .join (path , 'examples' , 'interp_1d.py' )
303- runpy .run_path (filename )
296+ runpy .run_module ('sdf.examples.interp_1d' )
304297
305298 def test_interp_2d_example (self ):
306- path , _ = os .path .split (__file__ )
307- filename = os .path .join (path , 'examples' , 'interp_2d.py' )
308- runpy .run_path (filename )
299+ runpy .run_module ('sdf.examples.interp_2d' )
309300
310301 def test_sine_example (self ):
311- path , _ = os .path .split (__file__ )
312- filename = os .path .join (path , 'examples' , 'sine.py' )
313- runpy .run_path (filename )
302+ runpy .run_module ('sdf.examples.sine' )
314303
315304 def test_spline_1d_example (self ):
316- path , _ = os .path .split (__file__ )
317- filename = os .path .join (path , 'examples' , 'spline_1d.py' )
318- runpy .run_path (filename )
305+ runpy .run_module ('sdf.examples.spline_1d' )
319306
320307if __name__ == "__main__" :
321308 unittest .main ()
0 commit comments