本文整理匯總了Python中socorro.external.postgresql.products.Products.get_default_version方法的典型用法代碼示例。如果您正苦於以下問題:Python Products.get_default_version方法的具體用法?Python Products.get_default_version怎麽用?Python Products.get_default_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類socorro.external.postgresql.products.Products
的用法示例。
在下文中一共展示了Products.get_default_version方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_default_version
# 需要導入模塊: from socorro.external.postgresql.products import Products [as 別名]
# 或者: from socorro.external.postgresql.products.Products import get_default_version [as 別名]
def test_get_default_version(self):
products = Products(config=self.config)
# Test 1: default versions for all existing products
res = products.get_default_version()
res_expected = {"hits": {"Firefox": "8.0", "Thunderbird": "10.0.2b", "Fennec": "12.0b1"}}
eq_(res, res_expected)
# Test 2: default version for one product
params = {"products": "Firefox"}
res = products.get_default_version(**params)
res_expected = {"hits": {"Firefox": "8.0"}}
eq_(res, res_expected)
# Test 3: default version for two products
params = {"products": ["Firefox", "Thunderbird"]}
res = products.get_default_version(**params)
res_expected = {"hits": {"Firefox": "8.0", "Thunderbird": "10.0.2b"}}
eq_(res, res_expected)