Example #1
0
    def testAddonLayoutTwoPlatforms(self):

        # Correct layout with one addon and two platforms

        blob = SystemAddonsBlob()
        blob.loadJSON(
            """
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "addons": {
            "c": {
                "version": "1",
                "platforms": {
                    "p": {
                        "alias": "q"
                    },
                    "q": {
                        "filesize": 2,
                        "hashValue": "3",
                        "fileUrl": "http://boring.com/blah"
                    }
                }
            }
        }
    }
    """
        )
        blob.validate("gg", self.whitelistedDomains)
Example #2
0
    def testAddonLayoutTwoPlatforms(self):

        # Correct layout with one addon and two platforms

        blob = SystemAddonsBlob()
        blob.loadJSON("""
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "addons": {
            "c": {
                "version": "1",
                "platforms": {
                    "p": {
                        "alias": "q"
                    },
                    "q": {
                        "filesize": 2,
                        "hashValue": "3",
                        "fileUrl": "http://boring.com/blah"
                    }
                }
            }
        }
    }
    """)
        blob.validate('gg', self.whitelistedDomains)
Example #3
0
    def testAddonLayoutWithUninstall(self):

        # Correct layout with no addons, and with uninstall

        blob = SystemAddonsBlob()
        blob.loadJSON("""
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "uninstall": false
    }
    """)
        blob.validate('gg', self.whitelistedDomains)
Example #4
0
    def testAddonLayoutEmptyAddons(self):

        # Correct layout with empty addons

        blob = SystemAddonsBlob()
        blob.loadJSON("""
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "addons": {}
    }
    """)
        blob.validate('gg', self.whitelistedDomains)
Example #5
0
    def testAddonLayoutWithUninstall(self):

        # Correct layout with no addons, and with uninstall

        blob = SystemAddonsBlob()
        blob.loadJSON("""
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "uninstall": false
    }
    """)
        blob.validate('gg', self.whitelistedDomains)
Example #6
0
    def testAddonLayoutEmptyAddons(self):

        # Correct layout with empty addons

        blob = SystemAddonsBlob()
        blob.loadJSON("""
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "addons": {}
    }
    """)
        blob.validate('gg', self.whitelistedDomains)
Example #7
0
    def testAddonLayoutEmptyPlatforms(self):

        # Correct layout with empty platforms

        blob = SystemAddonsBlob()
        blob.loadJSON(
            """
    {
        "name": "fake",
        "schema_version": 5000,
        "hashFunction": "SHA512",
        "addons": {
            "c": {
                "version": "1",
                "platforms": {}
            }
        }
    }
    """
        )
        blob.validate("gg", self.whitelistedDomains)