2017-02-25 6 views

答えて

0

インストールHTTPLibrary:RFコード

from HttpLibrary import HTTP 


class JsonLib(object): 

    def load_json_data_from_file(self, filepath): 
     """ Don't forget to document the keyword!!! 
     """ 
     json_string = open(filepath).read() 
     HTTP().should_be_valid_json(json_string) 
     return json_string 

インポートをし、あなたにそれを呼び出す:https://github.com/peritus/robotframework-httplibrary

JsonLib.pyを作成

*** Settings *** 
Library JsonLib.py 

*** Test Cases *** 
Do Whatever With My Json 
    [Documentation] Don't forget to document what your test does!!! 
    ${my_json} Load JSON Data From File ${/}foo{/}bar.json 
+0

の方法についてのファイルパスのフォーマットにWindowsでは? – Kion

+0

ああ...私はabotを考えていません... RF文書 –

+0

***の設定***の設定*** ライブラリJsonLib.py ***テストケース*** Do Whatever With My Json [Documentation]テストの内容を記録することを忘れないでください! $ {my_json}ファイルからJSONデータを読み込みます./cookie.json – Kion

関連する問題