有没有办法直接将字典传递给图书馆

Is there a way to directly pass a dictionary to a library

使用机器人框架,我知道可以将字典传递给如下函数:

*** Settings ***
Library             Collections
Library             SomeLibrary

*** Variables ***
&{Dict1}     key1=value1

*** Test Cases ***
    
Testcase 1
    SomeLibrary.SomeFunction  ${Dict1}

但是是否可以在不声明变量的情况下将字典传递给 SomeLibrary.SomeFunction?以下代码仅用于可视化:

*** Settings ***
Library             Collections
Library             SomeLibrary

*** Test Cases ***
    
Testcase 1
    SomeLibrary.SomeFunction  &{key1=value1}

从 robotframework 3.2 开始,您可以使用 inline python evaluation,它允许您将任何 python 代码放入 ${{}}:

SomeLibrary.SomeFunction  ${{ {'key1': 'value1'} }}