diff options
author | olly <olly@ollycope.com> | 2015-09-03 08:36:36 +0000 |
---|---|---|
committer | olly <olly@ollycope.com> | 2015-09-03 08:36:36 +0000 |
commit | 4ade7227b7aa2cfb7616010ab6571de712733694 (patch) | |
tree | d31348e6e10d2f3bca6a2b0c218ecaeb071dec56 | |
parent | cdff691fa38748ffb283791bf367b10b925d8c52 (diff) | |
download | yoyo-4ade7227b7aa2cfb7616010ab6571de712733694.tar.gz |
Change 'new_migration_command' config option to 'post_create_command'
The old setting name sounds more like a command used to create the migration
rather than something that is run post-creation.
-rw-r--r-- | yoyo/config.py | 2 | ||||
-rw-r--r-- | yoyo/tests/test_cli_script.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/yoyo/config.py b/yoyo/config.py index bc45486..354c4ca 100644 --- a/yoyo/config.py +++ b/yoyo/config.py @@ -20,7 +20,7 @@ from yoyo.compat import SafeConfigParser CONFIG_FILENAME = '.yoyorc' CONFIG_EDITOR_KEY = 'editor' -CONFIG_NEW_MIGRATION_COMMAND_KEY = 'new_migration_command' +CONFIG_NEW_MIGRATION_COMMAND_KEY = 'post_create_command' def update_argparser_defaults(parser, defaults): diff --git a/yoyo/tests/test_cli_script.py b/yoyo/tests/test_cli_script.py index 91c7371..570b3fd 100644 --- a/yoyo/tests/test_cli_script.py +++ b/yoyo/tests/test_cli_script.py @@ -393,12 +393,14 @@ class TestNewMigration(TestInteractiveScript): assert 'your ad here' in f.read() @with_migrations() - def test_it_calls_new_migration_command(self, tmpdir): - - self.writeconfig(new_migration_command='/bin/ls -l {}') + def test_it_calls_post_create_command(self, tmpdir): + self.writeconfig(post_create_command='/bin/ls -l {} {}') with frozendate.freeze(2001, 1, 1): main(['new', '-b', tmpdir, dburi]) + is_filename = tms.Str( + lambda s: os.path.basename(s).startswith('20010101_01_')) assert self.subprocess.call.call_args == call([ '/bin/ls', '-l', - tms.Str(lambda s: os.path.basename(s).startswith('20010101_01_'))]) + is_filename, + is_filename]) |