结构如下:

  appsdk\

    appsdk.py(这里面有多个类,包括appsdk,appsdksync等类)

    __init__.py

    ...

 

① 有个appsdk的文件夹(符合python包的定义)

② 将这个appsdk的文件夹copy到/usr/lib/python2.7/site-packages目录下

③ 进入这个appsdk文件夹,vim __init__.py,然后输入如下内容(这是一种参考模式,因为之前我试过很多方式,发现RF加载不了包里面的py里面的多个类):

from appsdk import appsdk  #py文件中的一个类
from appsdk import appsdksync  #py文件中的另一个类

__version__ = "0.1"  #版本说明
class appsdk(appsdk,appsdksync):  #使用继承的方法来访问关键字
  """
  This test library provides some keywords to allow
  opening, reading, writing, and saving Excel files
  from Robot Framework.
  """
  ROBOT_LIBRARY_SCOPE = 'GLOBAL'
  # def __init__(self,ip,port):
  # appsdksync.__init__(self,ip,port)
  def create_session(self,ip,port):
    appsdksync.__init__(self,ip,port)

相关文章:

  • 2022-12-23
  • 2021-12-16
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-02-09
  • 2022-02-08
  • 2022-02-09
  • 2022-02-09
相关资源
相似解决方案