summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-04-25 16:11:45 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-04-26 06:50:20 -0700
commit9768498a537f6046e30920982cf54c91d08d79fa (patch)
tree621699cf3f1b6c53d21ce176540d1f052fc55856 /tests
parent6e4948b95278f86f5bf2925308797c014cb31c59 (diff)
Provide file extension when when looking for files
* Allow an extension to be passed to find_config files, defaulting to '.conf' Change-Id: I022a3b28d9067158e9ed0da741a5e72cb73af167
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_cfg.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py
index 4e8ec21..da78254 100644
--- a/tests/unit/test_cfg.py
+++ b/tests/unit/test_cfg.py
@@ -133,6 +133,16 @@ class FindConfigFilesTestCase(BaseTestCase):
self.assertEquals(find_config_files(project='blaa'), config_files)
+ def test_find_config_files_with_extension(self):
+ config_files = ['/etc/foo.json']
+
+ self.stubs.Set(sys, 'argv', ['foo'])
+ self.stubs.Set(os.path, 'exists', lambda p: p in config_files)
+
+ self.assertEquals(find_config_files(project='blaa'), [])
+ self.assertEquals(find_config_files(project='blaa', extension='.json'),
+ config_files)
+
class CliOptsTestCase(BaseTestCase):