def test_get_config_filename_not_set(): """ If the envvar is not set, not filename is returned. """ metadata = Metadata("foo-bar") config_filename = get_config_filename(metadata) assert_that(config_filename, is_(none()))
def test_get_config_filename(): """ If the envvar is set, it is used as the filename. """ metadata = Metadata("foo-bar") with envvar("FOO_BAR_SETTINGS", "/tmp/foo-bar.conf"): config_filename = get_config_filename(metadata) assert_that(config_filename, is_(equal_to("/tmp/foo-bar.conf")))