Пример #1
0
def test_extend_with_external_config_not_req_not_exist(default_config,
                                                       default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    extend_with_external_config(default_config,
                                ("/some/bad/path", "some_bad.py"), required=False)
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
Пример #2
0
def test_extend_with_external_config_not_req_not_exist(default_config,
                                                       default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    extend_with_external_config(default_config,
                                ("/some/bad/path", "some_bad.py"), required=False)
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
Пример #3
0
def test_extend_with_external_config_not_req_exist(default_config,
                                                   default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    extend_with_external_config(default_config, (
        default_config.GENERAL_CONFIG_DIR, default_config.GENERAL_CONFIG_FILE),
                                required=False)
    assert default_config.int_val == 1
    assert default_config.str_val == 'value1'
Пример #4
0
def test_extend_with_external_config_req_not_exist(default_config,
                                                   default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    with pytest.raises(FileNotFoundError):
        extend_with_external_config(default_config, (
            "/some/bad/path", "some_bad.py"), required=True)
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
Пример #5
0
def test_extend_with_external_config_not_req_exist(default_config,
                                                   default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    extend_with_external_config(default_config, (
        default_config.GENERAL_CONFIG_DIR, default_config.GENERAL_CONFIG_FILE),
                                required=False)
    assert default_config.int_val == 1
    assert default_config.str_val == 'value1'
Пример #6
0
def test_extend_with_external_config_req_not_exist(default_config,
                                                   default_config_file_system):
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'
    with pytest.raises(FileNotFoundError):
        extend_with_external_config(default_config, (
            "/some/bad/path", "some_bad.py"), required=True)
    assert default_config.int_val == -1
    assert default_config.str_val == 'value-1'