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)
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)
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)
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)
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)