本文整理匯總了Python中socorro.external.postgresql.products.Products.post方法的典型用法代碼示例。如果您正苦於以下問題:Python Products.post方法的具體用法?Python Products.post怎麽用?Python Products.post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類socorro.external.postgresql.products.Products
的用法示例。
在下文中一共展示了Products.post方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_post_bad_product_name
# 需要導入模塊: from socorro.external.postgresql.products import Products [as 別名]
# 或者: from socorro.external.postgresql.products.Products import post [as 別名]
def test_post_bad_product_name(self):
products = Products(config=self.config)
ok_(not products.post(
product='Spaces not allowed',
version='',
))
示例2: test_post_bad_product_name
# 需要導入模塊: from socorro.external.postgresql.products import Products [as 別名]
# 或者: from socorro.external.postgresql.products.Products import post [as 別名]
def test_post_bad_product_name(self):
products = Products(config=self.config)
build_id = self.now.strftime('%Y%m%d%H%M')
ok_(not products.post(
product='Spaces not allowed',
version='',
))
示例3: test_post
# 需要導入模塊: from socorro.external.postgresql.products import Products [as 別名]
# 或者: from socorro.external.postgresql.products.Products import post [as 別名]
def test_post(self):
products = Products(config=self.config)
ok_(products.post(product="KillerApp", version="1.0"))
# let's check certain things got written to certain tables
cursor = self.connection.cursor()
try:
# expect there to be a new product
cursor.execute("select product_name from products " "where product_name=%s", ("KillerApp",))
product_name, = cursor.fetchone()
eq_(product_name, "KillerApp")
finally:
self.connection.rollback()
示例4: test_post
# 需要導入模塊: from socorro.external.postgresql.products import Products [as 別名]
# 或者: from socorro.external.postgresql.products.Products import post [as 別名]
def test_post(self):
products = Products(config=self.config)
build_id = self.now.strftime('%Y%m%d%H%M')
ok_(products.post(
product='KillerApp',
version='1.0',
))
# let's check certain things got written to certain tables
cursor = self.connection.cursor()
try:
# expect there to be a new product
cursor.execute(
'select product_name from products '
"where product_name=%s",
('KillerApp',)
)
product_name, = cursor.fetchone()
eq_(product_name, 'KillerApp')
finally:
self.connection.rollback()