def test_simple_zipdata_data(self): extension = models.Extension(creator=self.user) version = models.ExtensionVersion() version.extension = extension metadata = models.parse_zipfile(get_test_zipfile('SimpleExtension')) version.parse_metadata(metadata) self.assertEquals(extension.name, "Test Extension") self.assertEquals(extension.description, "Simple test metadata") self.assertEquals(extension.url, "http://test-metadata.gnome.org")
def test_extra_metadata(self): extension = models.Extension(creator=self.user) version = models.ExtensionVersion() version.extension = extension metadata = models.parse_zipfile(get_test_zipfile('ExtraMetadata')) version.parse_metadata(metadata) extra = json.loads(version.extra_json_fields) self.assertEquals(extra["extra"], "This is some good data") self.assertTrue("description" not in extra) self.assertTrue("url" not in extra)