def test_changelog_03(self):
        changes_1 = [u'Изменение 1', u'Изменение 2']
        version_1 = VersionInfo(Version(1, 2, 3, 100),
                                changes=changes_1)

        maintainer = u'Ivan Petrov'
        maintainer_email = u'*****@*****.**'
        changelog = [version_1]
        date_str = u'13.06.2016'

        appinfo = AppInfo(self._appname, None, changelog)
        generator = DebChangelogGenerator(appinfo,
                                          maintainer,
                                          maintainer_email)

        result = generator.make(self._distrib, date_str)

        result_right = u'''outwiker (1.2.3+100~distribname) distribname; urgency=medium

  * Изменение 1
  * Изменение 2

 -- Ivan Petrov <*****@*****.**>  13.06.2016'''

        self.assertEqual(result, result_right)
Example #2
0
    def _debuild(self, command, distriblist):
        """
        Run command with debuild.
        The function assembles the deb packages for all releases in distriblist
        """
        date = datetime.datetime.now()
        date_str = date.strftime(u'%a, %d %b %Y %H:%M:%S ' + TIMEZONE)
        outwiker_appinfo = getOutwikerAppInfo()
        changelog_generator = DebChangelogGenerator(outwiker_appinfo,
                                                    DEB_MAINTAINER,
                                                    DEB_MAINTAINER_EMAIL)

        for distrib_name in distriblist:
            self._orig(distrib_name)
            changelog = changelog_generator.make(distrib_name, date_str)
            current_debian_dirname = os.path.join(self.build_dir,
                                                  self._getDebName(),
                                                  'debian')

            # Change release name in the changelog file
            changelog_path = os.path.join(current_debian_dirname,
                                          u'changelog')
            writeTextFile(changelog_path, changelog)

            with lcd(current_debian_dirname):
                local(command)
Example #3
0
    def test_changelog_empty(self):
        maintainer = u'Ivan Petrov'
        maintainer_email = u'*****@*****.**'
        changelog = []
        date_str = u'13.06.2016'

        appinfo = AppInfo(self._appname, None, changelog)
        generator = DebChangelogGenerator(appinfo, maintainer,
                                          maintainer_email)

        self.assertRaises(ValueError, generator.make, self._distrib, date_str)
Example #4
0
    def test_changelog_02(self):
        changes_1 = [u'Изменение 1']
        version_1 = VersionInfo(Version(1, 2, 3, 100), changes=changes_1)

        maintainer = u'Ivan Petrov'
        maintainer_email = u'*****@*****.**'
        changelog = [version_1]
        date_str = u'13.06.2016'

        appinfo = AppInfo(self._appname, None, changelog)
        generator = DebChangelogGenerator(appinfo, maintainer,
                                          maintainer_email)

        result = generator.make(self._distrib, date_str)

        result_right = u'''outwiker (1.2.3+100~distribname) distribname; urgency=medium

  * Изменение 1

 -- Ivan Petrov <*****@*****.**>  13.06.2016'''

        self.assertEqual(result, result_right)