示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)