Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction between nested key and default #38

Open
SparkeyG opened this issue Oct 18, 2023 · 0 comments
Open

Interaction between nested key and default #38

SparkeyG opened this issue Oct 18, 2023 · 0 comments

Comments

@SparkeyG
Copy link
Contributor

When you have a nested key and also have a default value, you will always get the default value.

For the given test:

    def test_get_yaml_nested_default():
        g = gestalt.Gestalt()
        g.add_config_path("./tests/testdata")
        g.build_config()
        testval = g.get_string("deep_yaml.nest1.nest2.foo", 'default')
        assert testval == "hello"

the test will fail:

===================================================== FAILURES ======================================================
___________________________________________ test_get_yaml_nested_default ____________________________________________

    def test_get_yaml_nested_default():
        g = gestalt.Gestalt()
        g.add_config_path("./tests/testdata")
        g.build_config()
        testval = g.get_string("deep_yaml.nest1.nest2.foo", 'default')
>       assert testval == "hello"
E       AssertionError: assert 'default' == 'hello'
E         - hello
E         + default

tests/test_gestalt.py:249: AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant