コード例 #1
0
ファイル: data.py プロジェクト: HongNgan97/saucedemo
 def getProducts_json(self):
     products = []
     data = Utility.read_json(Data.PRODUCTS_JSON_FILE)
     for item in data['products']:
         product = Product(item['name'], item['desc'], item['price'])
         products.append(product)
     return products
コード例 #2
0
 def read_products_from_json(sefl):
     products = []
     data = Utility.read_json(Data.PRODUCT_FILE)
     for item in data['products']:
         product = Product(item['name'], item['desc'], item['price'])
         products.append(product)
     return products