如何将python文件(没有类)导入到机器人文件中

时间:2017-01-13 07:00:51

标签: python robotframework

我的python文件:

from libraries.Jpg import Jpg
def configure_jpg(jpg, ingress, egress, rep_factor=None):
    jpg_hd = Jpg(host=jpg)
    jpg_hd.inout_intf_rep_pair = ingress + ',1|' + egress + ',1'
    return jpg_hd.configure_jpg()

我的机器人文件:

*** Settings ***
Documentation  Resource file for Jpg.
...            This resource file has the keywords that can be used to perform
...            operations on Jpg devices
Variables   terralogic.yaml
Library jpg_stout
Library Collections
Library BuiltIn

*** Test Cases ***
Configure Jpg
    ${info} =   Convert To Dictionary   ${t.resources.device0.system.primary}
    ${ip} = Get Variable Value  ${info['mgt-ip']}
    Configure Jpg   jpg=${ip}   ingress='ge-2/0/0'  egress='xe-4/2/6'

当我运行Robot文件时,出现错误No keyword with name 'Configure Jpg' found.

Robot文件可以在没有类的情况下导入python文件吗?请帮帮我。

0 个答案:

没有答案