Пример #1
0
def test_is_none_interpolation(cfg: Any, key: str, is_none: bool) -> None:
    cfg = OmegaConf.create(cfg)
    with warns(UserWarning):
        assert OmegaConf.is_none(cfg, key) == is_none
    check = _is_none(cfg._get_node(key),
                     resolve=True,
                     throw_on_resolution_failure=False)
    assert check == is_none
Пример #2
0
 def test_is_none(self, type_: Callable[..., Any], input_: Any,
                  expected: bool) -> None:
     value = type_(input_) if input_ != "DEFAULT" else type_()
     assert _utils._is_none(value) == expected