Ejemplo n.º 1
0
    def test_fetch_information_spr_multiple_changelogs(self):
        # If previous_version is passed the "changelog" entry in the
        # returned dict should contain the changelogs for all SPRs *since*
        # that version and up to and including the passed SPR.
        changelog = self.factory.makeChangelog(spn="foo",
                                               versions=["1.2", "1.1", "1.0"])
        spph = self.factory.makeSourcePackagePublishingHistory(
            sourcepackagename="foo", version="1.3", changelog=changelog)
        self.layer.txn.commit()  # Yay, librarian.

        spr = spph.sourcepackagerelease
        info = fetch_information(spr, None, None, previous_version="1.0")

        self.assertIn("foo (1.1)", info['changelog'])
        self.assertIn("foo (1.2)", info['changelog'])
    def test_fetch_information_spr_multiple_changelogs(self):
        # If previous_version is passed the "changelog" entry in the
        # returned dict should contain the changelogs for all SPRs *since*
        # that version and up to and including the passed SPR.
        changelog = self.factory.makeChangelog(
            spn="foo", versions=["1.2",  "1.1",  "1.0"])
        spph = self.factory.makeSourcePackagePublishingHistory(
            sourcepackagename="foo", version="1.3", changelog=changelog)
        self.layer.txn.commit()  # Yay, librarian.

        spr = spph.sourcepackagerelease
        info = fetch_information(spr, None, None, previous_version="1.0")

        self.assertIn("foo (1.1)", info['changelog'])
        self.assertIn("foo (1.2)", info['changelog'])
Ejemplo n.º 3
0
 def test_fetch_information_spr(self):
     creator = self.factory.makePerson(displayname=u"foø")
     maintainer = self.factory.makePerson(displayname=u"bær")
     spr = self.factory.makeSourcePackageRelease(creator=creator,
                                                 maintainer=maintainer)
     info = fetch_information(spr, None, None)
     self.assertEqual(info['date'], spr.dateuploaded)
     self.assertEqual(info['changelog'], spr.changelog_entry)
     self.assertEqual(info['changedby'],
                      format_address_for_person(spr.creator))
     self.assertEqual(info['maintainer'],
                      format_address_for_person(spr.maintainer))
     self.assertEqual(u"foø <%s>" % spr.creator.preferredemail.email,
                      info['changedby_displayname'])
     self.assertEqual(u"bær <%s>" % spr.maintainer.preferredemail.email,
                      info['maintainer_displayname'])
Ejemplo n.º 4
0
 def test_fetch_information_bprs(self):
     bpr = self.factory.makeBinaryPackageRelease()
     info = fetch_information(None, [bpr], None)
     spr = bpr.build.source_package_release
     self.assertEqual(info['date'], spr.dateuploaded)
     self.assertEqual(info['changelog'], spr.changelog_entry)
     self.assertEqual(info['changedby'],
                      format_address_for_person(spr.creator))
     self.assertEqual(info['maintainer'],
                      format_address_for_person(spr.maintainer))
     self.assertEqual(
         info['changedby_displayname'],
         formataddr(
             (spr.creator.displayname, spr.creator.preferredemail.email)))
     self.assertEqual(
         info['maintainer_displayname'],
         formataddr((spr.maintainer.displayname,
                     spr.maintainer.preferredemail.email)))
Ejemplo n.º 5
0
 def test_fetch_information_changes(self):
     changes = {
         'Date': '2001-01-01',
         'Changed-By': 'Foo Bar <*****@*****.**>',
         'Maintainer': 'Foo Bar <*****@*****.**>',
         'Changes': ' * Foo!',
     }
     info = fetch_information(None, None, changes)
     self.assertEqual('2001-01-01', info['date'])
     self.assertEqual(' * Foo!', info['changelog'])
     fields = [
         info['changedby'],
         info['maintainer'],
         info['changedby_displayname'],
         info['maintainer_displayname'],
     ]
     for field in fields:
         self.assertEqual('Foo Bar <*****@*****.**>', field)
 def test_fetch_information_bprs(self):
     bpr = self.factory.makeBinaryPackageRelease()
     info = fetch_information(None, [bpr], None)
     spr = bpr.build.source_package_release
     self.assertEqual(info['date'], spr.dateuploaded)
     self.assertEqual(info['changelog'], spr.changelog_entry)
     self.assertEqual(
         info['changedby'], format_address_for_person(spr.creator))
     self.assertEqual(
         info['maintainer'], format_address_for_person(spr.maintainer))
     self.assertEqual(
         info['changedby_displayname'],
         formataddr((spr.creator.displayname,
                     spr.creator.preferredemail.email)))
     self.assertEqual(
         info['maintainer_displayname'],
         formataddr((spr.maintainer.displayname,
                     spr.maintainer.preferredemail.email)))
 def test_fetch_information_spr(self):
     creator = self.factory.makePerson(displayname=u"foø")
     maintainer = self.factory.makePerson(displayname=u"bær")
     spr = self.factory.makeSourcePackageRelease(
         creator=creator, maintainer=maintainer)
     info = fetch_information(spr, None, None)
     self.assertEqual(info['date'], spr.dateuploaded)
     self.assertEqual(info['changelog'], spr.changelog_entry)
     self.assertEqual(
         info['changedby'], format_address_for_person(spr.creator))
     self.assertEqual(
         info['maintainer'], format_address_for_person(spr.maintainer))
     self.assertEqual(
         u"foø <%s>" % spr.creator.preferredemail.email,
         info['changedby_displayname'])
     self.assertEqual(
         u"bær <%s>" % spr.maintainer.preferredemail.email,
         info['maintainer_displayname'])
 def test_fetch_information_changes(self):
     changes = {
         'Date': '2001-01-01',
         'Changed-By': 'Foo Bar <*****@*****.**>',
         'Maintainer': 'Foo Bar <*****@*****.**>',
         'Changes': ' * Foo!',
         }
     info = fetch_information(None, None, changes)
     self.assertEqual('2001-01-01', info['date'])
     self.assertEqual(' * Foo!', info['changelog'])
     fields = [
         info['changedby'],
         info['maintainer'],
         info['changedby_displayname'],
         info['maintainer_displayname'],
         ]
     for field in fields:
         self.assertEqual('Foo Bar <*****@*****.**>', field)