diff --git a/testsuite/pytests/sli2py_regressions/test_ticket_689.py b/testsuite/pytests/sli2py_regressions/test_ticket_689.py new file mode 100644 index 0000000000..868aef1eff --- /dev/null +++ b/testsuite/pytests/sli2py_regressions/test_ticket_689.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# +# test_ticket_689.py +# +# This file is part of NEST. +# +# Copyright (C) 2004 The NEST Initiative +# +# NEST is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# NEST is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with NEST. If not, see . + +import nest + +""" +Regression test for Ticket #689. + +Test ported from SLI regression test. +Ensure GetConnections works correctly with hpc synapses. + +Authors: Susanne Kunkel and Maximilian Schmidt, 2012-02-19 +""" + + +def test_ticket_689_getconnections_with_hpc_synapse(): + """ + Ensure retrieving connections with stdp_pl_synapse_hom_hpc succeeds. + """ + + nest.ResetKernel() + nest.total_num_virtual_procs = 1 + + n1 = nest.Create("iaf_psc_alpha") + n2 = nest.Create("iaf_psc_alpha") + + nest.Connect(n1, n2, conn_spec={"rule": "all_to_all"}, syn_spec="stdp_pl_synapse_hom_hpc") + + connections = nest.GetConnections(target=n2) + + assert len(connections) == 1 diff --git a/testsuite/regressiontests/ticket-689.sli b/testsuite/regressiontests/ticket-689.sli deleted file mode 100644 index ca016be51e..0000000000 --- a/testsuite/regressiontests/ticket-689.sli +++ /dev/null @@ -1,53 +0,0 @@ -/* - * ticket-689.sli - * - * This file is part of NEST. - * - * Copyright (C) 2004 The NEST Initiative - * - * NEST is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * NEST is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with NEST. If not, see . - * - */ - -/** @BeginDocumentation - -Name: testsuite::ticket-689 - GetConnections throws Segmentation Fault if hpc_synapses are used. - -Synopsis: (ticket-689) run -> NEST exits if test fails - -Description: -Ensure that GetConnections works with hpc synapses. Script creates 2 neurons, connects them -with an hpc synapse and tests whether GetConnections retrieves 1 connection without crashing. - -Author: Susanne Kunkel, Maximilian Schmidt, 2012-02-19 - */ - -(unittest) run -/unittest using - -M_ERROR setverbosity - -<< - /total_num_virtual_procs 1 ->> SetKernelStatus - -/iaf_psc_alpha Create /n1 Set -/iaf_psc_alpha Create /n2 Set -n1 n2 /all_to_all /stdp_pl_synapse_hom_hpc Connect - -{ - << /target n2 >> GetConnections Flatten length 1 eq -} assert_or_die - -endusing