本文整理汇总了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()