當前位置: 首頁>>代碼示例>>Python>>正文


Python Products.post方法代碼示例

本文整理匯總了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='',
        ))
開發者ID:4thAce,項目名稱:socorro,代碼行數:9,代碼來源:test_products.py

示例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='',
        ))
開發者ID:SKY51717,項目名稱:socorro,代碼行數:10,代碼來源:test_products.py

示例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()
開發者ID:snorp,項目名稱:socorro,代碼行數:16,代碼來源:test_products.py

示例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()
開發者ID:SKY51717,項目名稱:socorro,代碼行數:24,代碼來源:test_products.py


注:本文中的socorro.external.postgresql.products.Products.post方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。