File: test_examples.py

package info (click to toggle)
nmodl 0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,016 kB
  • sloc: cpp: 28,492; javascript: 9,841; yacc: 2,804; python: 1,971; lex: 1,674; xml: 181; sh: 136; ansic: 37; makefile: 17; pascal: 7
file content (22 lines) | stat: -rw-r--r-- 516 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from json import loads
from pathlib import Path

from nmodl import dsl


def test_example():
    """
    Test for the Python API from example
    """

    examples = dsl.list_examples()

    # ordering may be off so we use a set
    assert set(examples) == {"exp2syn.mod", "expsyn.mod", "hh.mod", "passive.mod"}

    driver = dsl.NmodlDriver()
    for example in examples:
        nmodl_string = dsl.load_example(example)
        # make sure we can parse the string
        assert driver.parse_string(nmodl_string)