From 05a3cf2bcde06984b2407593768657e5997aad1e Mon Sep 17 00:00:00 2001 From: George Dang <53052793+gtdang@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:48:52 -0400 Subject: [PATCH] test: added test for synaptic gains getter method --- hnn_core/tests/test_network.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hnn_core/tests/test_network.py b/hnn_core/tests/test_network.py index 79756d803..a0c170c39 100644 --- a/hnn_core/tests/test_network.py +++ b/hnn_core/tests/test_network.py @@ -895,8 +895,8 @@ def test_network_mesh(): _ = law_2021_model(mesh_shape=mesh_shape) -def test_synaptic_gains(): - """Test synaptic gains update""" +def test_set_synaptic_gains(): + """Test synaptic gains setter""" net = jones_2009_model() nb_base = NetworkBuilder(net) e_cell_names = ['L2_pyramidal', 'L5_pyramidal'] @@ -963,6 +963,16 @@ def _get_weight(nb, conn_name, idx=0): _get_weight(nb_base, 'L2Pyr_L5Basket_ampa')) == 1 +def test_get_synaptic_gains(): + """Test synaptic gains getter.""" + net = jones_2009_model() + assert net.get_synaptic_gains() == {'e_e': 1.0, 'e_i': 1.0, + 'i_e': 1.0, 'i_i': 1.0} + new_gains = {'e_e': 0.5, 'e_i': 1.5, 'i_e': 0.75, 'i_i': 1.0} + net.set_synaptic_gains(**new_gains) + assert net.get_synaptic_gains() == new_gains + + class TestPickConnection: """Tests for the pick_connection function.""" @pytest.mark.parametrize("arg_name",