Permalink
Browse files

Added test case to check no warnings are thrown if a configuration fi…

…le only included other configuration files. Fixes #449
  • Loading branch information...
1 parent 2c5645e commit 9cc8b27d67ab3cf9e7cd40eef6282ea3ea0985b0 @sudarshang sudarshang committed Jan 23, 2013
Showing with 43 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +42 −0 tests/test_option_store.py
View
@@ -5,6 +5,7 @@
*.swp
.project
.pydevproject
+.ropeproject/
build
dist
mrjob.egg-info
View
@@ -235,6 +235,48 @@ def test_empty_runner_error(self):
"No configs specified for inline runner\n",
stderr.getvalue())
+ def test_conf_contain_only_include_file(self):
+ """If a config file only include other configuration files
+ no warnings are thrown as long as the included files are
+ not empty.
+ """
+
+ # dummy configuration for include file 1
+ conf = {
+ 'runners': {
+ 'inline': {
+ 'base_tmp_dir': "include_file1_base_tmp_dir"
+ }
+ }
+ }
+
+ include_file_1 = self.save_conf('include_file_1', conf)
+
+ # dummy configuration for include file 2
+ conf = {
+ 'runners': {
+ 'inline': {
+ 'base_tmp_dir': "include_file2_base_tmp_dir"
+ }
+ }
+ }
+
+ include_file_2 = self.save_conf('include_file_2', conf)
+
+ # test configuration
+ conf = {
+ 'include': [include_file_1, include_file_2]
+ }
+ path = self.save_conf('twoincludefiles', conf)
+
+ stderr = StringIO()
+ with no_handlers_for_logger():
+ log_to_stream('mrjob.runner', stderr)
+ RunnerOptionStore('inline', {}, [path])
+ self.assertEqual(
+ "",
+ stderr.getvalue())
+
class MultipleMultipleConfigFilesTestCase(ConfigFilesTestCase):

0 comments on commit 9cc8b27

Please sign in to comment.