How to use the castero.config._Config function in castero

To help you get started, we’ve selected a few castero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xgi / castero / tests / test_player.py View on Github external
def restore_config_data():
    yield
    Config.data = castero.config._Config().data
github xgi / castero / tests / test_config.py View on Github external
def test_config_length():
    myconfig = config._Config()
    assert isinstance(len(myconfig), int) and len(myconfig) > 0
github xgi / castero / tests / test_config.py View on Github external
def test_config_try_set_item():
    myconfig = config._Config()
    myconfig["fake"] = "value"
    assert "fake" not in myconfig
github xgi / castero / tests / test_config.py View on Github external
def test_config_get_item():
    myconfig = config._Config()
    seek_distance_forward = myconfig["seek_distance_forward"]
    assert seek_distance_forward is not None
github xgi / castero / tests / test_config.py View on Github external
def test_config_iter():
    myconfig = config._Config()
    for key in myconfig:
        assert key in myconfig
github xgi / castero / tests / test_config.py View on Github external
def test_config_incomplete_migrate():
    copyfile(my_dir + "/datafiles/incomplete_error.conf", config._Config.PATH)
    myconfig = config._Config()
    assert len(myconfig) > 0
github xgi / castero / tests / test_config.py View on Github external
def test_config_del_item():
    myconfig = config._Config()
    del myconfig["seek_distance_forward"]
    assert "seek_distance_forward" not in myconfig
github xgi / castero / tests / test_config.py View on Github external
def test_config_default():
    myconfig = config._Config()
    assert isinstance(myconfig, config._Config)
github xgi / castero / tests / test_config.py View on Github external
def test_config_excessive_migrate():
    copyfile(my_dir + "/datafiles/excessive_error.conf", config._Config.PATH)
    myconfig = config._Config()
    assert "this_should_not_be_here" not in myconfig
    assert "seek_distance_forward" in myconfig
    assert "seek_distance_backward" in myconfig
github xgi / castero / tests / test_config.py View on Github external
def test_config_parse_error():
    config._Config.DEFAULT_PATH = my_dir + "/datafiles/parse_error.conf"
    with pytest.raises(config.ConfigParseError):
        config._Config()