Exemplo n.º 1
0
    def test_dateBasedWithPatchVersionNameValid(self):
        """ Date based version in manifest is ok. Add-ons use this scheme.
		"""
        self._setupVersions(submissionFileNameVer='13.6.5',
                            versionNum=VersionNumber(13, 6, 5),
                            versionName="13.06.5",
                            manifestVersion="13.06.5")
        errors = list(
            validate.checkVersions(self.manifest, self.fileName,
                                   self.submissionData))
        self.assertEqual([], errors)
Exemplo n.º 2
0
    def test_valid(self):
        """No error when:
			- manifest version matches submission addonVersionName
			- submission file name matches submission addonVersionNumber (fully qualified)
			- submission addonVersionName can be parsed and matches addonVersionNumber
		"""
        versionName = "13.6.5"
        self._setupVersions(submissionFileNameVer=versionName,
                            versionNum=VersionNumber(13, 6, 5),
                            versionName=versionName,
                            manifestVersion=versionName)
        errors = list(
            validate.checkVersions(self.manifest, self.fileName,
                                   self.submissionData))
        self.assertEqual([], errors)
Exemplo n.º 3
0
    def test_versionNameMustMatchManifest(self):
        """ Ensure there is no mistake with the release submission, the submission addonVersionName must match
		the version field from the manifest.
		"""
        self._setupVersions(submissionFileNameVer="12.2.0",
                            versionNum=VersionNumber(12, 2),
                            versionName="12.2",
                            manifestVersion="13.2")
        errors = list(
            validate.checkVersions(self.manifest, self.fileName,
                                   self.submissionData))
        self.assertEqual(
            [  # expected errors
                ("Submission data 'addonVersionName' field does not match 'version' field"
                 " in addon manifest: 13.2 vs addonVersionName: 12.2")
            ],
            errors)
Exemplo n.º 4
0
    def test_unparseableVersionName(self):
        """ Error when versionName include characters unable to be parsed to numeric form.
		These situations will need to be considered manually.
		"""
        self._setupVersions(submissionFileNameVer='13.6.0',
                            versionNum=VersionNumber(13, 6),
                            versionName="13.06-NG",
                            manifestVersion="13.06-NG")
        errors = list(
            validate.checkVersions(self.manifest, self.fileName,
                                   self.submissionData))
        self.assertEqual(
            [  # expected errors
                ("Warning: submission data 'addonVersionName' and 'addonVersionNumber' "
                 'mismatch.  Unable to parse: 13.06-NG and match with 13.6.0')
            ],
            errors)
Exemplo n.º 5
0
    def test_fileNameMustUseFullyQualifiedVersion(self):
        """Error expected when fileName is not a fully qualified (trailing zero's included),
		dot separated representation of the addonVersionNumber: eg '21.3.0.json'
		"""
        versionName = "13.6"
        self._setupVersions(
            submissionFileNameVer=versionName,  # expect "13.6.0"
            versionNum=VersionNumber(13, 6),
            versionName=versionName,
            manifestVersion=versionName)
        errors = list(
            validate.checkVersions(self.manifest, self.fileName,
                                   self.submissionData))
        self.assertEqual(
            [  # expected errors
                'Submission filename and versionNumber mismatch error:'
                ' versionNumberField: 13.6.0'
                ' version from submission filename: 13.6'
                ' expected submission filename: 13.6.0.json'
            ],
            errors)