-
-
Notifications
You must be signed in to change notification settings - Fork 6
fix: configurable rebranding #7
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
Changes from all commits
4915566
bd42df1
d68f624
cfe12aa
902aa5d
18ea3e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from enum import Enum | ||
|
|
||
|
|
||
| class Branding(Enum): | ||
| CODECOV = "codecov" | ||
| PREVENT = "prevent" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import click | ||
|
|
||
| from codecov_cli.fallbacks import BrandedOption | ||
| from codecov_cli.branding import Branding | ||
|
|
||
| from click.testing import CliRunner | ||
|
|
||
|
|
||
| @click.group() | ||
| @click.pass_context | ||
| def cli(ctx): | ||
| ctx.obj = {} | ||
| ctx.obj["branding"] = [Branding.CODECOV, Branding.PREVENT] | ||
|
|
||
|
|
||
| @cli.command() | ||
| @click.option("--test", cls=BrandedOption, envvar="TEST") | ||
| @click.pass_context | ||
| def hello_world(ctx, test): | ||
| click.echo(f"{test}") | ||
|
|
||
|
|
||
| def test_branded_option(): | ||
| runner = CliRunner() | ||
|
|
||
| result = runner.invoke(cli, ["hello-world"], env={"CODECOV_TEST": "hello_codecov"}) | ||
| assert result.output == "hello_codecov\n" | ||
|
|
||
| result = runner.invoke(cli, ["hello-world"], env={"PREVENT_TEST": "hello_prevent"}) | ||
| assert result.output == "hello_prevent\n" | ||
|
|
||
| result = runner.invoke(cli, ["hello-world"]) | ||
| assert result.output == "None\n" |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait so is it yml-path for preventcli and codecov-yml-path for codecovcli?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JW why the commands list for codecovcli didn't change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed it is |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.