Skip to content

Port regression test 708 to Pytests #3483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions testsuite/pytests/sli2py_regressions/test_issue_708.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# -*- coding: utf-8 -*-
#
# test_issue_708.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 <http://www.gnu.org/licenses/>.
"""
Regression test for Issue #708 (GitHub).

This test ensures that CopyModel works with connection types that use secondary events.
"""

import nest
import pytest


@pytest.mark.skipif_without_gsl
def test_copymodel_with_secondary_events():
"""
Test that CopyModel works with connection types that use secondary events.
"""
nest.ResetKernel()

neuron_in = nest.Create("hh_psc_alpha_gap")
neuron_out1 = nest.Create("hh_psc_alpha_gap")
neuron_out2 = nest.Create("hh_psc_alpha_gap")
vm1 = nest.Create("voltmeter")
vm2 = nest.Create("voltmeter")

nest.CopyModel("gap_junction", "syn0")
nest.CopyModel("gap_junction", "syn1")

nest.SetStatus(neuron_in, {"I_e": 200.0})
nest.SetStatus(vm1, {"interval": 1.0})
nest.SetStatus(vm2, {"interval": 1.0})

nest.Connect(
neuron_in,
neuron_out1,
conn_spec={"rule": "one_to_one", "make_symmetric": True},
syn_spec={"synapse_model": "syn0", "weight": 10.0},
)

nest.Connect(
neuron_in,
neuron_out2,
conn_spec={"rule": "one_to_one", "make_symmetric": True},
syn_spec={"synapse_model": "syn1", "weight": 10.0},
)

nest.Connect(vm1, neuron_out1)
nest.Connect(vm2, neuron_out2)

nest.Simulate(10.0)

# Check that neuron_out1 received the input
events_vm1 = nest.GetStatus(vm1, "events")[0]
V_m_vm1 = events_vm1["V_m"]
assert V_m_vm1[8] > -6.960401e01

# Check that neuron_out2 received the input
events_vm2 = nest.GetStatus(vm2, "events")[0]
V_m_vm2 = events_vm2["V_m"]
assert V_m_vm2[8] > -6.960401e01
90 changes: 0 additions & 90 deletions testsuite/regressiontests/issue-708.sli

This file was deleted.

Loading