From 6a764b6fbc0a75556882e8c9930c3b6a2921bf3f Mon Sep 17 00:00:00 2001 From: Hans Ekkehard Plesser Date: Wed, 7 Mar 2018 22:39:25 +0100 Subject: [PATCH] Made path construction os-independent. --- pynest/nest/tests/test_use_gid_in_filename.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pynest/nest/tests/test_use_gid_in_filename.py b/pynest/nest/tests/test_use_gid_in_filename.py index a2ea7e73f0..5cc4592f17 100644 --- a/pynest/nest/tests/test_use_gid_in_filename.py +++ b/pynest/nest/tests/test_use_gid_in_filename.py @@ -40,11 +40,11 @@ def test_WithGid(self): sd = nest.Create("spike_detector", 1, {"to_file": True, "label": "sd", "use_gid_in_filename": True}) nest.Connect(sg, sd) - nest.Simulate(100) - self.assertTrue(os.path.exists(os.environ["NEST_DATA_PATH"] + - "/sd-2-0.gdf")) + expected = os.path.join(os.environ["NEST_DATA_PATH"], + "sd-{}-0.gdf".format(sd[0])) + self.assertTrue(os.path.exists(expected)) def test_NoGid(self): """Without GID""" @@ -58,8 +58,9 @@ def test_NoGid(self): nest.Simulate(100) - self.assertTrue(os.path.exists(os.environ["NEST_DATA_PATH"] + - "/sd-0.gdf")) + expected = os.path.join(os.environ["NEST_DATA_PATH"], + "sd-0.gdf") + self.assertTrue(os.path.exists(expected)) def suite():