Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit d1758ba

Browse files
author
Jaquier Aurélien Tristan
committed
add load_component test
1 parent f9ac053 commit d1758ba

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

bluepyopt/tests/test_ephys/test_create_acc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,10 @@ def check_acc_dir(test_dir, ref_dir):
665665
with open(ref_dir_file / file) as f:
666666
ref_file = f.read()
667667
assert ref_file == test_file
668+
# check that load_component is not raising any error here
669+
fpath = pathlib.Path(test_dir) / file
670+
if fpath.suffix == "acc":
671+
arbor.load_component(fpath).component
668672

669673

670674
@pytest.mark.unit

bluepyopt/tests/test_ephys/test_parameterscalers.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,5 @@ def test_parameterscalers_iexpr():
173173
decor_filename = pathlib.Path(test_dir).joinpath("decor.acc")
174174
with open(decor_filename, "w") as f:
175175
f.write(simple_cell_decor_with_iexpr)
176-
test_decor = arbor.load_component(decor_filename).component
177-
assert test_decor.defaults() == []
178-
assert test_decor.placements() == []
179-
assert len(test_decor.paintings()) == 2
180-
assert test_decor.paintings()[0][0] == '(region "soma")'
181-
assert str(test_decor.paintings()[0][1]) == 'Cm=0.01'
182-
assert test_decor.paintings()[1][0] == '(region "soma")'
183-
scaled_mech_str = "<arbor.scaled_mechanism<density> " \
184-
"(mechanism('default::hh', %s), " \
185-
'{"gkbar": (sub (scalar 0.621094) (mul (log (scalar 3.14159)) ' \
186-
'(exp (div (distance 1 (region "soma")) ' \
187-
'(scalar 0.421875)))))})>'
188-
str1 = scaled_mech_str % '{"gkbar": 0.0271248, "gnabar": 0.102993}'
189-
str2 = scaled_mech_str % '{"gnabar": 0.102993, "gkbar": 0.0271248}'
190-
assert str(test_decor.paintings()[1][1]) in [str1, str2]
176+
# check that load_component is not raising any error here
177+
arbor.load_component(decor_filename).component

0 commit comments

Comments
 (0)