慕碼人8056858
2021-06-30 17:42:46
所以可以說我在python中有這個方法def get_data(notificaition): print("Notification Recived: ", notificaition)然后我有另一種方法可以接收事件并獲取該事件的值。def verify_singal_r(): with Session() as session: connection = Connection("http://example/signalr", session) print(connection) logging.info("got the connection") presenceservice = connection.register_hub('MyHub') connection.start() def print_error(error): print('error: ', error) connection.error += print_error # TODO: NEED TO ADD POST REQUEST HERE presenceservice.client.on('Notified', get_data) connection.wait(10)一旦關(guān)鍵字Verify_Signal運行,我就會得到我需要的值并將它們打印到控制臺上如何使用get_data機器人框架中的值?我試著簡單地使用*** Test Cases ***Get Event Back verify_singal_r get_data但這不起作用,因為 get_data 需要參數(shù)。
2 回答

料青山看我應(yīng)如是
TA貢獻1772條經(jīng)驗 獲得超8個贊
你的職能
def get_data(notificaition):
print("Notification Recived: ", notificaition)
期待爭論
但是,當您在機器人框架中調(diào)用它時
*** Test Cases ***
Get Event Back
verify_singal_r
get_data
你沒有提供任何論據(jù)。
你可以試試這樣的
*** Variables ***
${notification} Test
*** Test Cases ***
Get Event Back
verify_singal_r
get_data ${notification}
這將解決您的問題。

縹緲止盈
TA貢獻2041條經(jīng)驗 獲得超4個贊
你的方法
def get_data(notificaition):
print("Notification Recived: ", notificaition)
不返回任何內(nèi)容,因此機器人框架關(guān)鍵字也不會返回任何內(nèi)容。
添加回答
舉報
0/150
提交
取消