コード例 #1
0
def test_load_config():
    """
    Test load config
    """
    cfg = Configuration()
    with patch("molior.molior.configuration.open",
               mock_open(read_data="{'test': 'config'}")):
        path = "/"
        cfg._load_config(path)
        assert cfg._config == {"test": "config"}
コード例 #2
0
def test_load_config_non_existent():
    """
    Test load config non-existent
    """
    cfg = Configuration()
    with patch("molior.molior.configuration.logger"):
        assert cfg._load_config(Path("/non/existent")) is None
コード例 #3
0
def test_load_config_non_existent():
    """
    Test load config non-existent
    """
    cfg = Configuration()
    assert cfg._load_config(Path("/non/existent")) is None