-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactoring language_container_deployer #162
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
88c4647
Refactoring language_container_deployer
ahsimb 8721eaa
Update exasol_transformers_extension/deployment/language_container_de…
ahsimb 5946073
Update exasol_transformers_extension/deployment/language_container_de…
ahsimb 98b2591
Update exasol_transformers_extension/deployment/language_container_de…
ahsimb 7d4f31b
Generalising the cli
ahsimb 7e4b099
Generalising the cli finalized
ahsimb 05236b0
Little change in a doc and [CodeBuild]
ahsimb 4fbb826
Another little change in a doc and [CodeBuild]
ahsimb 914f862
Merge branch 'main' into refactoring/159-prepare-deployment-migration
tkilias 16581a8
Updating the branch [CodeBuild]
ahsimb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/unit_tests/deployment/test_language_container_deployer_cli.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import click | ||
from exasol_transformers_extension.deployment.language_container_deployer_cli import ( | ||
_ParameterFormatters, CustomizableParameters) | ||
|
||
|
||
def test_parameter_formatters_1param(): | ||
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. wow, I like that |
||
cmd = click.Command('a_command') | ||
ctx = click.Context(cmd) | ||
opt = click.Option(['--version']) | ||
formatters = _ParameterFormatters() | ||
formatters.set_formatter(CustomizableParameters.container_url, 'http://my_server/{version}/my_stuff') | ||
formatters.set_formatter(CustomizableParameters.container_name, 'downloaded') | ||
formatters(ctx, opt, '1.3.2') | ||
assert ctx.params[CustomizableParameters.container_url.name] == 'http://my_server/1.3.2/my_stuff' | ||
assert ctx.params[CustomizableParameters.container_name.name] == 'downloaded' | ||
|
||
|
||
def test_parameter_formatters_2params(): | ||
cmd = click.Command('a_command') | ||
ctx = click.Context(cmd) | ||
opt1 = click.Option(['--version']) | ||
opt2 = click.Option(['--user']) | ||
formatters = _ParameterFormatters() | ||
formatters.set_formatter(CustomizableParameters.container_url, 'http://my_server/{version}/{user}/my_stuff') | ||
formatters.set_formatter(CustomizableParameters.container_name, 'downloaded-{version}') | ||
formatters(ctx, opt1, '1.3.2') | ||
formatters(ctx, opt2, 'cezar') | ||
assert ctx.params[CustomizableParameters.container_url.name] == 'http://my_server/1.3.2/cezar/my_stuff' | ||
assert ctx.params[CustomizableParameters.container_name.name] == 'downloaded-1.3.2' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an example how the pattern looks at the end and what it matches might be useful