Skip to content

Commit

Permalink
Fix test data
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz committed Jul 30, 2023
1 parent b7a3238 commit 496b826
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

*KEYWORDs data driven columns for col names # robotidy: off

*** coMment *** # robotidy: off
*** coMment *** # robotidy: off
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
*** Settings ***
Library ExampleLibrary @{lib_args}
Library ${library} @{lib_args}

Variables ${name}.py
Resource ${curdir}/${name}.robot

Suite Setup Some Keyword @{kw_args}
Suite Teardown ${keyword} @{kw_args}
Test Setup Some Keyword @{kw_args}
Test Teardown ${keyword} @{kw_args}

Default Tags @{tags} tag_${name}
Test Timeout ${timeout}

Metadata ${item} ${value}


*** Variables ***
${variable} value_
${var_iable} ${va_lue}
${variable} This is string with ${variable}
${${var}} value
${variable} ${${variable}}
${variable} ${var_${variable}_var}
${variable} String with ${${variable}}
${variable} ${variable['item_access']}
${variable} ${variable}[item_access]
${variable} ${variable}[${item}_access]
${variable} ${variable['${variable}']}
${variable} ${_}____
${vari_able} ${wo_rd}
${variable} \${escaped}
${inline_eval} ${{ eval }}

&{dict} item=value
... item=${value}
@{list} value
... other ${value}
... ${{embedd_ ed}

${camel_case_name} ${camel_case_name}
${camel_case_name} ${camel_case_name}
${camel_case_name} ${camel_case_name}
${camel_case_name_word_camel_case} ${camel_case_name_word_camel_case}


*** Test Cases ***
Assign
${variable} Keyword
${multiple}
... ${variables} Keyword
${variable} = Keyword
${variable}= Keyword
Keyword ${nested_${variable}}

Args
Keyword ${variable}
Keyword ${v_a_ri_ables}
... value with ${variable}

For header
${local} Set Variable item
FOR ${item} IN @{list}
Log ${item}
Do Stuff String with ${local} value
... ${lo_cal} # TODO We could normalize it to look as first local matching variable
END
Log ${global}
Log ${item}
FOR ${index} ${item} IN ENUMERATE @{list}
Log ${index} ${item}
END
Log ${local['item']}
Log ${global['item']}

Test With Variables In Keyword Call
[Setup] ${keyword}
${local} Set Variable local value
Keyword Call With ${variable}
Keyword Call With ${local}
${global} Keyword Call With ${global}
[Teardown] ${local}

Test case with ${VARIABLE} in name
[Documentation] The RF surprises me vol. 678
Step


*** Keywords ***
Arguments
[Arguments] ${arg} ${arg2}
Step ${arg}
Step ${arg3}

Kwargs
[Arguments] ${arg} &{kwargs}
Step

Defaults
[Arguments] ${arg} ${arg2} = 'default'
Step

Defaults With Global
[Arguments] ${arg} ${arg2} =${global}
Step

Defaults With Other Arg
[Arguments] ${arg} ${arg2} = ${arg}
Step

Embedded ${arguments} that ${should_be_lower} and also ${pattern:\S}
Log ${should_be_lower}
Log ${global}
Log ${pattern}
9 changes: 9 additions & 0 deletions tests/atest/transformers/RenameVariables/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ def test_lower_case(self):
source="test.robot",
expected="test_lower.robot",
config=":settings_section_case=lower:variables_section_case=lower:unknown_variables_case=lower",
target_version="<6.1",
)

def test_lower_case_rf61(self):
self.compare(
source="test.robot",
expected="test_lower_with_nested.robot",
config=":settings_section_case=lower:variables_section_case=lower:unknown_variables_case=lower",
target_version=">=6.1",
)

def test_ignore_unknown_case(self):
Expand Down

0 comments on commit 496b826

Please sign in to comment.