From 43038d3150b3ec47abfbc55b2c843bf1d30489e3 Mon Sep 17 00:00:00 2001 From: Ulrich Petri Date: Sat, 24 Nov 2012 14:53:22 +0100 Subject: [PATCH] Added tests for config file loading --- tests/dummy_settings.py | 1 + tests/test_scripts.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/dummy_settings.py create mode 100644 tests/test_scripts.py diff --git a/tests/dummy_settings.py b/tests/dummy_settings.py new file mode 100644 index 0000000..1404250 --- /dev/null +++ b/tests/dummy_settings.py @@ -0,0 +1 @@ +REDIS_HOST = "testhost.example.com" diff --git a/tests/test_scripts.py b/tests/test_scripts.py new file mode 100644 index 0000000..de266ef --- /dev/null +++ b/tests/test_scripts.py @@ -0,0 +1,8 @@ +from unittest import TestCase +from rq.scripts import read_config_file + +class TestScripts(TestCase): + def test_config_file(self): + settings = read_config_file("tests.dummy_settings") + self.assertIn("REDIS_HOST", settings) + self.assertEqual(settings['REDIS_HOST'], "testhost.example.com")