<commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from webapi_tests.semiauto import TestCase
from webapi_tests.apps import AppsTestCommon


class TestAppsBasic(TestCase, AppsTestCommon):
    def setUp(self):
        super(TestAppsBasic, self).setUp()
        self.wait_for_obj("window.navigator.mozApps")

    def test_get_self(self):
        app = self.get_self()
        self.assertEqual(app["manifest"]["name"], "CertTest App", "Application name is different from CertTest App")
        self.assertEqual(app["manifest"]["description"], "Generated app", "Application description is different from Generated app")

    def test_get_all(self):
        applist = self.get_all()
        for app in applist:
            if app["manifest"]["name"] == "CertTest App":
                self.assertEqual(app["manifest"]["developer"]["url"], "https://wiki.mozilla.org/Auto-tools",
                                "Application developer url is different from https://wiki.mozilla.org/Auto-tools")
                self.assertEqual(app["origin"], "app://certtest-app", "Application origin is different from app://certtest-app")<commit_msg>Bug 1110545 - Temporarily disable apps tests<commit_after># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

import unittest
from webapi_tests.semiauto import TestCase
from webapi_tests.apps import AppsTestCommon


class TestAppsBasic(TestCase, AppsTestCommon):
    def setUp(self):
        super(TestAppsBasic, self).setUp()
        self.wait_for_obj("window.navigator.mozApps")

    @unittest.skip("Bug 1110545 - test times out")
    def test_get_self(self):
        app = self.get_self()
        self.assertEqual(app["manifest"]["name"], "CertTest App", "Application name is different from CertTest App")
        self.assertEqual(app["manifest"]["description"], "Generated app", "Application description is different from Generated app")

    @unittest.skip("Bug 1110545 - test times out")
    def test_get_all(self):
        applist = self.get_all()
        for app in applist:
            if app["manifest"]["name"] == "CertTest App":
                self.assertEqual(app["manifest"]["developer"]["url"], "https://wiki.mozilla.org/Auto-tools",
                                "Application developer url is different from https://wiki.mozilla.org/Auto-tools")
                self.assertEqual(app["origin"], "app://certtest-app", "Application origin is different from app://certtest-app")
{'fraction_non_alphanumeric': 0.1225759238931577, 'fraction_numerical': 0.010611050128064398, 'mean_word_length': 3.33968253968254, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5091580', 'n_tokens_mistral': 799, 'n_tokens_neox': 756, 'n_words': 224}