Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-25028 change butler create --config-file to --seed-config & DM-25151 in butler CLI add -h as an alias for --help #297

Merged
merged 6 commits into from Jun 2, 2020

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Jun 1, 2020

No description provided.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactoring of the tests.

@@ -253,7 +253,7 @@ def get_command(self, context, name):
return doImport(commands[name][0] + "." + cmdNameToFuncName(name))


@click.command(cls=LoaderCLI)
@click.command(cls=LoaderCLI, context_settings=dict(help_option_names=['-h', '--help']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment but in daf_butler we always prefer double quotes to single quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. This was copy/paste and I didn't notice the quotes, will fix.

@@ -50,7 +49,7 @@ def butler_import(*args, **kwargs):

@click.command()
@repo_argument(help=repo_argument.will_create_repo)
@config_file_option(help="Path to an existing YAML config file to apply (on top of defaults).")
@click.option("--seed-config", help="Path to an existing YAML config file to apply (on top of defaults).")
@click.option("--standalone", is_flag=True, help="Include all defaults in the config file in the repo, "
"insulating the repo from changes in package defaults.")
@click.option("--override", "-o", is_flag=True, help="Allow values in the supplied config to override any "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to remove the -o here since it's a very rare option and it's likely that we'll be using -o elsewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also change text to "...supplied seed config to override all repo defaults"

from ..cli import butler


class MockeredTestBase(unittest.TestCase, abc.ABC):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"mockered"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the risk of being too cute, I have a class called Mocker that wraps a static instance of MagicMock. This test uses a Mocker and so is Mockered.

remove -o because --option is a rarely used option and so don't
squat on that short option alias.

fix the --override help text
@n8pease n8pease merged commit 81b6a7e into master Jun 2, 2020
@timj timj deleted the tickets/DM-25028 branch February 16, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants