Commit c7c41d96 authored by Martin Claus's avatar Martin Claus

Added test case

parent 8b94fbba
......@@ -4,3 +4,4 @@ dist
namelist.egg-info
*.pyc
.coverage
.cache
......@@ -215,6 +215,17 @@ def test_var_array(string, arr):
assert type(a) == type(b)
@pytest.mark.parametrize("string", ["&nml {} /"])
@pytest.mark.parametrize("d", [{1: 'lalal', 2: 35},])
def test_index_assignment(string, d):
val_str = ""
for k, v in d.items():
val_str += "val({}) = {} ".format(k, v)
nml_string = string.format(val_str)
nml = namelist.parse_namelist_string(nml_string)["nml"]
print(nml_string)
assert nml["val"] == d
@pytest.mark.parametrize("string", ["&nml val= {}, val2='lsl'/"])
@pytest.mark.parametrize("op", ["+", "-", "/", "*", "**"])
@pytest.mark.parametrize(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment