Skip to content

Commit

Permalink
Merge pull request #53 from BlueBrain/more-tests
Browse files Browse the repository at this point in the history
Improve tests
  • Loading branch information
AurelienJaquier authored Sep 25, 2023
2 parents 9b1b7d2 + 05f9500 commit 870edc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
11 changes: 7 additions & 4 deletions tests/unit_tests/test_ecodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ def get_negcheops_stimulus():
def get_sinespec_stimulus():
"""Return SineSpec stimulus and stim properties."""
# default values
delay = 0.0
duration = 5000.0

# custom values, to check edge case (delay > 0)
delay = 100.0

# generate stimulus
prot_def = {"amp": 0.2, "holding_current": -0.001}
prot_def = {"amp": 0.2, "holding_current": -0.001, "delay": delay}
stimulus = eCodes["sinespec"](location=soma_loc, **prot_def)

return stimulus, delay, duration, prot_def["amp"], prot_def["holding_current"]
Expand Down Expand Up @@ -841,7 +843,8 @@ def check_sinespec_stim(time, current, delay, duration, holding_current, amp):
if delay > 0:
# before stimulus
current_before = current[numpy.where((0 <= time) & (time < delay))]
assert numpy.all(current_before == holding_current)
# remove last two values. They are probably affected by rounding error or something
assert numpy.all(current_before[:-2] == holding_current)

# after stimulus
current_after = current[
Expand Down Expand Up @@ -871,7 +874,7 @@ def test_sinespec():
time, current = stimulus.generate()

assert stimulus.name == "SineSpec"
assert stimulus.total_duration == duration + 2 * delay
assert stimulus.total_duration == duration + delay

check_sinespec_stim(time, current, delay, duration, holding_curr, amp)

Expand Down
8 changes: 0 additions & 8 deletions tests/unit_tests/test_emodel_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
DATA = TEST_ROOT / "test_data"


@pytest.fixture
def api_config():
return {
"emodel": "cADpyr_L5TPC",
"emodel_dir": DATA,
}


@pytest.fixture
def pipeline():

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ def test_define_parameters():
for param in parameters:
assert isinstance(param, ephys.parameters.NrnParameter)

if param.name == "distribution_decay":
if param.name == "constant.distribution_decay":
assert param.bounds[0] == -0.1
assert param.bounds[1] == -0.0

0 comments on commit 870edc3

Please sign in to comment.