From a716285ed0bed5012554e13e15eea5d1ba21ca24 Mon Sep 17 00:00:00 2001 From: Jorge Niedbalski R Date: Sat, 22 Jun 2013 07:14:08 -0700 Subject: [PATCH] Added coverage for get_default_config_file, also a test for default config overrides --- tests/test_003-config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_003-config.py b/tests/test_003-config.py index d4865de5..6fcc317c 100644 --- a/tests/test_003-config.py +++ b/tests/test_003-config.py @@ -193,6 +193,19 @@ def test_cli_overrides_config(): t.eq(app.cfg.bind, ["blarney"]) t.eq(app.cfg.proc_name, "fooey") +def test_default_config_file(): + default_config = os.path.join(os.path.abspath(os.getcwd()), + 'gunicorn.conf.py') + with open(default_config, 'w+') as default: + default.write("bind='0.0.0.0:9090'") + + t.eq(config.get_default_config_file(), default_config) + + with AltArgs(["prog_name"]): + app = NoConfigApp() + t.eq(app.cfg.bind, ["0.0.0.0:9090"]) + + os.unlink(default_config) def test_post_request(): c = config.Config()