-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore[test_files.py]: Add test for transform and validate
- Loading branch information
Artem Vasenin
committed
Sep 23, 2020
1 parent
aa1ce34
commit 9fb912a
Showing
4 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from ntc import CN | ||
|
||
from .base_cfg import cfg as bc | ||
|
||
cfg = CN(bc) | ||
cfg.NAME = "Name" | ||
|
||
|
||
def transform(cfg: CN): | ||
if cfg.DICT.FOO == "foo": | ||
cfg.DICT.FOO = "bar" | ||
|
||
|
||
cfg.transform = transform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from ntc import CN | ||
|
||
from .base_cfg import cfg as bc | ||
|
||
cfg = CN(bc) | ||
cfg.NAME = "Name" | ||
|
||
|
||
def validate(cfg: CN): | ||
assert cfg.NAME != "Name" | ||
|
||
|
||
cfg.validate = validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters