Skip to content

Commit 6d4cbca

Browse files
committed
test(nml): add test for cell.get_parameters
1 parent edc706a commit 6d4cbca

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

neuroml/test/test_cell.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,31 @@ def test_get_morphology_root(self):
410410
def runTest(self):
411411
print("Running tests in TestCell")
412412

413+
def test_get_parameters(self):
414+
"""Test get_parameters"""
415+
cells = ["pyr_4_sym"]
416+
417+
for cell_name in cells:
418+
local_path = "../examples/test_files/%s.cell.nml" % cell_name
419+
if os.path.isfile(local_path):
420+
test_file_path = local_path
421+
else:
422+
root_dir = os.path.dirname(neuroml.__file__)
423+
test_file_path = os.path.join(
424+
root_dir, "examples/test_files/%s.cell.nml" % cell_name
425+
)
426+
print("test file path is: " + test_file_path)
427+
428+
doc = loaders.NeuroMLLoader.load(test_file_path)
429+
acell = doc.cells[0] # type: neuroml.Cell
430+
431+
parameters = acell.get_parameters()
432+
433+
self.assertEquals(parameters["id"], acell.id)
434+
self.assertEquals(
435+
parameters["ChannelDensity:LeakConductance_pyr_all"]["erev"], "-66.0 mV"
436+
)
437+
413438

414439
if __name__ == "__main__":
415440
ta = TestCell()

0 commit comments

Comments
 (0)