コード例 #1
0
    def test_isDeprecated( self ):
        canonicalPath = ToolBOSSettings.canonicalPath

        logging.info( 'testing canonicalPath=%s' % canonicalPath )
        ProjectProperties.requireIsCanonicalPath( canonicalPath )

        # ToolBOSCore never becomes deprecated, I hope ;-)
        self.assertFalse( ProjectProperties.isDeprecated( canonicalPath ) )

        # check for invalid parameter types (boolean + list)
        self.assertRaises( AssertionError, ProjectProperties.isDeprecated, True )
        self.assertRaises( AssertionError, ProjectProperties.isDeprecated, [ 1, 2, 3 ] )
コード例 #2
0
    def retrieveMetaInfoFromSIT(self):
        """
            Helper function which retrieves as much as possible information
            from a package installed into SIT, f.i. all info from pkgInfo.py.
        """
        self._parsePkgInfo()
        self.vcsRevision = self.gitCommitIdLong

        if self.gitOrigin and self.gitCommitIdLong:
            self.vcsBranch = self.gitBranch
            self.vcsRevision = self.gitCommitIdLong
            self.vcsRelPath = self.gitRelPath
            self.vcsURL = self.gitOrigin
            self.vcsRoot = self.gitOrigin

            Any.requireIsTextNonEmpty(self.vcsURL)
            Any.requireIsTextNonEmpty(self.vcsRevision)
            Any.isOptional(self.vcsRelPath)

        elif self.svnRepositoryURL and self.svnRevision:
            self.vcsURL = self.svnRepositoryURL
            self.vcsRevision = self.svnRevision
            self.vcsRelPath = self.svnRelPath
            self.vcsRoot = self.svnRepositoryRoot

            # svnRelPath is not present in pkgInfo.py but solely computed
            # from the svnRepositoryURL and svnRepositoryRoot
            self.svnRelPath = os.path.relpath(self.svnRepositoryURL,
                                              self.svnRepositoryRoot)
            self.vcsRelPath = self.svnRelPath

            Any.requireIsTextNonEmpty(self.vcsURL)
            Any.requireIsTextNonEmpty(self.vcsRoot)
            Any.requireIsIntNotZero(self.vcsRevision)
            Any.isOptional(self.vcsRelPath)

        if not self.vcsURL:
            logging.debug('neither SVN nor Git repository information found')

        self.isDeprecated = ProjectProperties.isDeprecated(self.canonicalPath)