Den Aufruf einer bestimmten Methode aus python-Modul in ROBOT framework

Habe ich ein Python-Modul, mit 2 Klassen. Jede Klasse hat einen Satz von Funktionen oder Methoden definiert werden. Wie können wir den Aufruf einer bestimmten Methode aus einer Klasse in das ROBOT framework. Ich versuche den unten Methode jedoch seine Angabe die folgenden Fehler. Kann mir bitte jemand helfen bei der Ermittlung der Problem hier. Das Python-Modul und der Roboter Dateien im gleichen Pfad.Ich habe versucht, die änderung der library-Anweisung zu CheckCode.Mitarbeiter WITH_NAME xyz. Dies hat nicht geholfen. Danke.

ERRORS
==============

[ WARN ] Imported library '/homes/user/New/CheckCode.py' contains no keywords.
==============================================================================
CheckCode :: Checking small built in code                                     
==============================================================================
Verify we can call a particular class from a Python Module in Robot   | FAIL |
No keyword with name 'my_code.employee.staff info' found.
------------------------------------------------------------------------------
CheckCode :: Checking small built in code                             | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================


Python Module File output
******************************

import re
import collections
import math

class person():
    def __init__(self,first,last):
        self.firstname = first
        self.lastname = last

    def emp_name(self):
        return self.firstname + " " + self.lastname

class employee(person):
    def __init__(self,first,last,empId):
        person.__init__(self,first,last)
        self.staffId = empId

    def staff_info(self):
        return self.Name() + " " + self.staffId

ROBOT FILE 
******************************

*** Settings ***
Documentation    Checking small built in code
Library   BuiltIn
Library   Collections
Library   CheckCode.py     WITH NAME   my_code

*** Test Cases ***
Verify we can call a particular class from a Python Module in Robot
    Log     Hello World
    ${var} =    my_code.employee.staff info     Maggi       Nestle      20000


*** Keywords ***
Init
    Set Log Level    DEBUG

InformationsquelleAutor user2905950 | 2017-04-16

Schreibe einen Kommentar