summaryrefslogtreecommitdiff
path: root/test/test_spikes.py
diff options
context:
space:
mode:
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>2015-12-14 01:53:21 +0100
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>2015-12-14 01:53:21 +0100
commit45d4fac7b207bb5ce98f17433a443837fce0455a (patch)
treeb3fb8b503351a5a332608b53ac997fddb51134cc /test/test_spikes.py
parent692a5773c85e08a690bc5406147e58c4f10b6628 (diff)
tests: allow to run out-of-tree
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'test/test_spikes.py')
-rw-r--r--test/test_spikes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_spikes.py b/test/test_spikes.py
index d4eb131..609a819 100644
--- a/test/test_spikes.py
+++ b/test/test_spikes.py
@@ -13,10 +13,12 @@ from numpy.testing import assert_equal
import pyspike as spk
+import os
+TEST_PATH = os.path.dirname(os.path.realpath(__file__))
+TEST_DATA = os.path.join(TEST_PATH, "PySpike_testdata.txt")
def test_load_from_txt():
- spike_trains = spk.load_spike_trains_from_txt("test/PySpike_testdata.txt",
- edges=(0, 4000))
+ spike_trains = spk.load_spike_trains_from_txt(TEST_DATA, edges=(0, 4000))
assert len(spike_trains) == 40
# check the first spike train
@@ -48,8 +50,7 @@ def check_merged_spikes(merged_spikes, spike_trains):
def test_merge_spike_trains():
# first load the data
- spike_trains = spk.load_spike_trains_from_txt("test/PySpike_testdata.txt",
- edges=(0, 4000))
+ spike_trains = spk.load_spike_trains_from_txt(TEST_DATA, edges=(0, 4000))
merged_spikes = spk.merge_spike_trains([spike_trains[0], spike_trains[1]])
# test if result is sorted