Skip to content

Commit

Permalink
test(good): multiple inheritance loads
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Mikhaylov committed Dec 3, 2020
1 parent 4861a8f commit 13298ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/data/good/inheritance_changes_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ntc import CN
from tests.data.good.inheritance import cfg

cfg = CN(cfg)
cfg.DICT.BAR = "QUUX"
8 changes: 8 additions & 0 deletions tests/test_good.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ def test_inheritance_changes_separation():
CN.load(DATA_DIR / "inheritance_changes.py")
with pytest.raises(AttributeError):
cfg.DICT.BAR


def test_inheritance_changes_multiple_loads():
cfg1 = CN.load(DATA_DIR / "inheritance_changes.py")
cfg2 = CN.load(DATA_DIR / "inheritance_changes_2.py")

assert cfg1.DICT.BAR == "BAZ"
assert cfg2.DICT.BAR == "QUUX"

0 comments on commit 13298ef

Please sign in to comment.