Skip to content

Commit

Permalink
Rename last options in test vectors to camel-case. (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Apr 18, 2023
1 parent e596379 commit 1637259
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
16 changes: 8 additions & 8 deletions test-vectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ test_vectors:
\ :ansopt:`foo=bar`\ \ :ansopt:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz.bam
type: boo
ansible_doc_text: |-
Expand Down Expand Up @@ -528,10 +528,10 @@ test_vectors:
\ :ansopt:`foo=bar`\ \ :ansopt:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz
type: role
role_entrypoint: main
roleEntrypoint: main
ansible_doc_text: |-
`foo' (of role foo.bar.baz, main entrypoint) `bar.baz[123].bam[len(x) - 1]' (of role foo.bar.baz, main entrypoint)
Expand Down Expand Up @@ -817,7 +817,7 @@ test_vectors:
\ :ansopt:`foo=bar`\ \ :ansopt:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz.bam
type: boo
ansible_doc_text: |-
Expand Down Expand Up @@ -975,10 +975,10 @@ test_vectors:
\ :ansopt:`foo=bar`\ \ :ansopt:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz
type: role
role_entrypoint: main
roleEntrypoint: main
ansible_doc_text: |-
`foo' (of role foo.bar.baz, main entrypoint) `bar.baz[123].bam[len(x) - 1]' (of role foo.bar.baz, main entrypoint)
Expand Down Expand Up @@ -1196,7 +1196,7 @@ test_vectors:
\ :ansretval:`foo=bar`\ \ :ansretval:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz.bam
type: boo
ansible_doc_text: |-
Expand Down Expand Up @@ -1412,7 +1412,7 @@ test_vectors:
\ :ansretval:`foo=bar`\ \ :ansretval:`bar.baz[123].bam[len(x) - 1]=bar`\
parse_opts:
current_plugin:
currentPlugin:
fqcn: foo.bar.baz.bam
type: boo
ansible_doc_text: |-
Expand Down
34 changes: 17 additions & 17 deletions tests/unit/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def get_context_parse_opts(test_data: t.Mapping[str, t.Any]):
parse_opts = {}
context_opts = {}
if test_data.get("parse_opts"):
if "current_plugin" in test_data["parse_opts"]:
if "currentPlugin" in test_data["parse_opts"]:
context_opts["current_plugin"] = dom.PluginIdentifier(
fqcn=test_data["parse_opts"]["current_plugin"]["fqcn"],
type=test_data["parse_opts"]["current_plugin"]["type"],
fqcn=test_data["parse_opts"]["currentPlugin"]["fqcn"],
type=test_data["parse_opts"]["currentPlugin"]["type"],
)
if "role_entrypoint" in test_data["parse_opts"]:
context_opts["role_entrypoint"] = test_data["parse_opts"]["role_entrypoint"]
if "roleEntrypoint" in test_data["parse_opts"]:
context_opts["role_entrypoint"] = test_data["parse_opts"]["roleEntrypoint"]
if "errors" in test_data["parse_opts"]:
parse_opts["errors"] = test_data["parse_opts"]["errors"]
if "onlyClassicMarkup" in test_data["parse_opts"]:
Expand All @@ -72,10 +72,10 @@ def get_html_opts_link_provider(test_data: t.Mapping[str, t.Any]):
opts["par_start"] = test_data["html_opts"]["parStart"]
if "parEnd" in test_data["html_opts"]:
opts["par_end"] = test_data["html_opts"]["parEnd"]
if "current_plugin" in test_data["html_opts"]:
if "currentPlugin" in test_data["html_opts"]:
opts["current_plugin"] = dom.PluginIdentifier(
fqcn=test_data["html_opts"]["current_plugin"]["fqcn"],
type=test_data["html_opts"]["current_plugin"]["type"],
fqcn=test_data["html_opts"]["currentPlugin"]["fqcn"],
type=test_data["html_opts"]["currentPlugin"]["type"],
)
link_provider._update(test_data["html_opts"])
return opts, link_provider
Expand All @@ -85,10 +85,10 @@ def get_md_opts_link_provider(test_data: t.Mapping[str, t.Any]):
opts = {}
link_provider = _TestLinkProvider()
if test_data.get("md_opts"):
if "current_plugin" in test_data["md_opts"]:
if "currentPlugin" in test_data["md_opts"]:
opts["current_plugin"] = dom.PluginIdentifier(
fqcn=test_data["md_opts"]["current_plugin"]["fqcn"],
type=test_data["md_opts"]["current_plugin"]["type"],
fqcn=test_data["md_opts"]["currentPlugin"]["fqcn"],
type=test_data["md_opts"]["currentPlugin"]["type"],
)
link_provider._update(test_data["md_opts"])
return opts, link_provider
Expand All @@ -97,20 +97,20 @@ def get_md_opts_link_provider(test_data: t.Mapping[str, t.Any]):
def get_rst_opts(test_data: t.Mapping[str, t.Any]):
opts = {}
if test_data.get("rst_opts"):
if "current_plugin" in test_data["rst_opts"]:
if "currentPlugin" in test_data["rst_opts"]:
opts["current_plugin"] = dom.PluginIdentifier(
fqcn=test_data["rst_opts"]["current_plugin"]["fqcn"],
type=test_data["rst_opts"]["current_plugin"]["type"],
fqcn=test_data["rst_opts"]["currentPlugin"]["fqcn"],
type=test_data["rst_opts"]["currentPlugin"]["type"],
)
return opts


def get_ansible_doc_text_opts(test_data: t.Mapping[str, t.Any]):
opts = {}
if test_data.get("ansible_doc_text_opts"):
if "current_plugin" in test_data["ansible_doc_text_opts"]:
if "currentPlugin" in test_data["ansible_doc_text_opts"]:
opts["current_plugin"] = dom.PluginIdentifier(
fqcn=test_data["ansible_doc_text_opts"]["current_plugin"]["fqcn"],
type=test_data["ansible_doc_text_opts"]["current_plugin"]["type"],
fqcn=test_data["ansible_doc_text_opts"]["currentPlugin"]["fqcn"],
type=test_data["ansible_doc_text_opts"]["currentPlugin"]["type"],
)
return opts

0 comments on commit 1637259

Please sign in to comment.