diff options
author | olly <olly@ollycope.com> | 2015-09-08 15:51:30 +0000 |
---|---|---|
committer | olly <olly@ollycope.com> | 2015-09-08 15:51:30 +0000 |
commit | af83d1174b0c7ea9bd29b8ef2e10b67df59569d5 (patch) | |
tree | bf67d80c8e0be742b4ec81f21f1bf2ec370e5f7b | |
parent | 3f3e3f2d592e6dc3fad88fa814d4e905471d3128 (diff) | |
download | yoyo-af83d1174b0c7ea9bd29b8ef2e10b67df59569d5.tar.gz |
Fix type of 'sources' config file item
-rwxr-xr-x | yoyo/scripts/main.py | 3 | ||||
-rw-r--r-- | yoyo/tests/test_cli_script.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/yoyo/scripts/main.py b/yoyo/scripts/main.py index 9ca87ec..f1b0740 100755 --- a/yoyo/scripts/main.py +++ b/yoyo/scripts/main.py @@ -78,6 +78,9 @@ def parse_args(argv=None): except configparser.NoOptionError: pass + if 'sources' in defaults: + defaults['sources'] = defaults['sources'].split() + # Set the argparser defaults to values read from the config file update_argparser_defaults(globalparser, defaults) update_argparser_defaults(argparser, defaults) diff --git a/yoyo/tests/test_cli_script.py b/yoyo/tests/test_cli_script.py index a357f5a..7bfe49d 100644 --- a/yoyo/tests/test_cli_script.py +++ b/yoyo/tests/test_cli_script.py @@ -207,7 +207,7 @@ class TestArgParsing(TestInteractiveScript): database='postgresql:///foo') _, _, args = parse_args(['apply']) assert args.database == 'postgresql:///foo' - assert args.sources == '/tmp/migrations' + assert args.sources == ['/tmp/migrations'] def test_it_uses_interpolated_values_from_config(self): self.writeconfig(sources='%(here)s/migrations') |