当前位置: 首页>>代码示例>>Python>>正文


Python addons_api.AddOnsAPI类代码示例

本文整理汇总了Python中pages.desktop.addons_api.AddOnsAPI的典型用法代码示例。如果您正苦于以下问题:Python AddOnsAPI类的具体用法?Python AddOnsAPI怎么用?Python AddOnsAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AddOnsAPI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_that_compatible_applications_equal

    def test_that_compatible_applications_equal(self, mozwebqa):
        """Test for Litmus 15323."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        firebug_page.expand_version_information()
        browser_compatible_applications = firebug_page.compatible_applications

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_compatible_applications = addons_xml.get_compatible_applications("firebug")
        name = xml_compatible_applications[0]
        min_version = xml_compatible_applications[1]
        max_version = xml_compatible_applications[2]
        
        # E.g.: Works with Firefox 1.0
        meta_compat_prefix = 'Works with %s %s ' % (name, min_version)
        # E.g.: Works with Firefox 1.0 and later
        meta_compat_abbrev = meta_compat_prefix + 'and later'
        # E.g.: Works with Firefox 1.0 - 16.0a1
        meta_compat_full = "%s- %s" % (meta_compat_prefix, max_version)
        
        assert (browser_compatible_applications == meta_compat_full or
                browser_compatible_applications == meta_compat_abbrev or
                browser_compatible_applications.startswith(meta_compat_prefix)
                ), "Listed compat. versions don't match versions listed in API."
开发者ID:AutomatedTester,项目名称:Addon-Tests,代码行数:26,代码来源:test_details_page_against_xml.py

示例2: test_that_description_text_is_correct

    def test_that_description_text_is_correct(self, mozwebqa):
        """Test for Litmus 15321."""
        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_description = firebug_page.description

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_description = addons_xml.get_addon_description(self.firebug)

        Assert.equal(browser_description.replace('\n', ''), xml_description.replace('\n', ''))
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:11,代码来源:test_details_page_against_xml.py

示例3: test_that_support_url_is_correct

    def test_that_support_url_is_correct(self, mozwebqa):
        """Test for Litmus 15337."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_support_url = firebug_page.support_url

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_support_url = addons_xml.get_support_url("firebug")

        Assert.equal(browser_support_url, xml_support_url)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例4: test_that_learn_more_link_is_correct

    def test_that_learn_more_link_is_correct(self, mozwebqa):
        """Test for Litmus 15326."""

        #browser
        initial_page = Details(mozwebqa, 'MemChaser')

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        learn_more_url = addons_xml.get_learn_more_url(self.firebug)
        addons_xml.goto_url_from_xml(learn_more_url)

        Assert.not_none(re.search(self.firebug, initial_page.page_title))
开发者ID:tobbi,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例5: test_that_rating_in_api_equals_rating_in_details_page

    def test_that_rating_in_api_equals_rating_in_details_page(self, mozwebqa):
        """Test for Litmus 15325."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_rating = firebug_page.rating

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_rating = addons_xml.get_rating("firebug")

        Assert.equal(browser_rating, xml_rating)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例6: test_that_reviews_in_api_equals_reviews_in_details_page

    def test_that_reviews_in_api_equals_reviews_in_details_page(self, mozwebqa):
        """Test for Litmus 15330."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_reviews = firebug_page.total_reviews_count

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_reviews = addons_xml.get_reviews_count("firebug")

        Assert.equal(browser_reviews, xml_reviews)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例7: test_that_home_page_in_api_equals_home_page_in_details_page

    def test_that_home_page_in_api_equals_home_page_in_details_page(self, mozwebqa):
        """Test for Litmus 15336."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_home_page = urlparse.unquote(firebug_page.website)

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_home_page = addons_xml.get_home_page("firebug")

        Assert.contains(xml_home_page, browser_home_page)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例8: test_that_daily_users_in_api_equals_daily_users_in_details_page

    def test_that_daily_users_in_api_equals_daily_users_in_details_page(self, mozwebqa):
        """Test for Litmus 15333."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_daily_users = firebug_page.daily_users_number

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_daily_users = addons_xml.get_daily_users("firebug")

        Assert.equal(browser_daily_users, xml_daily_users)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例9: test_that_learn_more_link_is_correct

    def test_that_learn_more_link_is_correct(self, mozwebqa):
        """Test for Litmus 15326."""

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        learn_more_url = addons_xml.get_learn_more_url(self.firebug)

        #browser
        details_page = Details(mozwebqa)
        details_page.get_url(learn_more_url)

        Assert.contains(self.firebug, details_page.page_title)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例10: test_that_firebug_summary_is_correct

    def test_that_firebug_summary_is_correct(self, mozwebqa):
        """Test for Litmus 15320."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_summary = firebug_page.summary

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_summary = addons_xml.get_addon_summary(self.firebug)

        Assert.equal(xml_summary, browser_summary)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:12,代码来源:test_details_page_against_xml.py

示例11: test_that_addon_number_of_total_downloads_is_correct

    def test_that_addon_number_of_total_downloads_is_correct(self, mozwebqa):
        """Test for Litmus 15331."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        statistics_page = firebug_page.click_view_statistics()
        browser_downloads = statistics_page.total_downloads_number

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_downloads = addons_xml.get_total_downloads("firebug")

        Assert.equal(browser_downloads, xml_downloads)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:13,代码来源:test_details_page_against_xml.py

示例12: test_that_icon_is_correct

    def test_that_icon_is_correct(self, mozwebqa):
        """Test for Litmus 15322."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_icon = firebug_page.icon_url

        #api
        addons_xml = AddOnsAPI(mozwebqa)

        xml_icon = addons_xml.get_icon_url(self.firebug)

        Assert.equal(browser_icon, xml_icon)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:13,代码来源:test_details_page_against_xml.py

示例13: test_that_firebug_devs_comments_is_correct

    def test_that_firebug_devs_comments_is_correct(self, mozwebqa):
        """Test for Litmus 15329."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        firebug_page.click_devs_comments()
        browser_devs_comments = firebug_page.devs_comments_message

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_devs_comments = addons_xml.get_devs_comments(self.firebug)

        Assert.equal(xml_devs_comments, browser_devs_comments)
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:13,代码来源:test_details_page_against_xml.py

示例14: test_that_compatible_applications_equal

    def test_that_compatible_applications_equal(self, mozwebqa):
        """Test for Litmus 15323."""

        #browser
        firebug_page = Details(mozwebqa, self.firebug)
        firebug_page.click_version_information_header()
        browser_compatible_applications = firebug_page.compatible_applications

        #api
        addons_xml = AddOnsAPI(mozwebqa)
        xml_compatible_applications = addons_xml.get_compatible_applications("firebug")
        name = xml_compatible_applications[0]
        min_version = xml_compatible_applications[1]
        max_version = xml_compatible_applications[2]
        Assert.equal(browser_compatible_applications, 'Works with %s %s - %s' % (name, min_version, max_version))
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:15,代码来源:test_details_page_against_xml.py

示例15: test_that_firebug_authors_is_correct

    def test_that_firebug_authors_is_correct(self, mozwebqa):
        """Test for Litmus 15319."""

        #get authors from browser
        firebug_page = Details(mozwebqa, self.firebug)
        browser_authors = firebug_page.authors

        #get authors from xml
        addons_xml = AddOnsAPI(mozwebqa)
        xml_authors = addons_xml.get_list_of_addon_author_names(self.firebug)

        #check that both lists have the same number of authors
        Assert.equal(len(browser_authors), len(xml_authors))

        #cross check both lists with each other
        for i in range(len(xml_authors)):
            Assert.equal(xml_authors[i], browser_authors[i])
开发者ID:lukeis,项目名称:Addon-Tests,代码行数:17,代码来源:test_details_page_against_xml.py


注:本文中的pages.desktop.addons_api.AddOnsAPI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。