Skip to content

Commit

Permalink
fix issue where manifest could be empty (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Mar 22, 2023
1 parent 201a3d3 commit 839c910
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bluepysnap/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def __init__(self, config, config_dir):
Parser: A Parser object.
"""
content = config.copy()

self.manifest = Parser._resolve_manifest(content.pop("manifest", {}), config_dir)
manifest = content.pop("manifest", None) or {}
self.manifest = Parser._resolve_manifest(manifest, config_dir)
self.content = content

@staticmethod
Expand Down
17 changes: 17 additions & 0 deletions tests/test_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,20 @@ def test_pickle(tmp_path):

assert pickle_path.stat().st_size < 200
assert list(circuit.edges) == ["default", "default2"]


def test_empty_manifest(tmp_path):
path = tmp_path / "circuit_config.json"
with open(path, "w") as fd:
json.dump(
{
"manifest": {},
"networks": {
"nodes": {},
"edges": {},
},
},
fd,
)

test_module.Circuit(path)

0 comments on commit 839c910

Please sign in to comment.