997
997
self.assertEqual(0, unreferenced_msgsets.count())
999
def test_SourcePackageReleaseDscBinariesUpdater_updates_incorrect(self):
1000
# SourcePackageReleaseDscBinariesUpdater fixes incorrectly-separated
1001
# dsc_binaries values.
1002
LaunchpadZopelessLayer.switchDbUser('testadmin')
1003
spr = self.factory.makeSourcePackageRelease(
1004
dsc_binaries="one two three")
1005
transaction.commit()
1007
self.assertEqual("one, two, three", spr.dsc_binaries)
1009
def test_SourcePackageReleaseDscBinariesUpdater_skips_correct(self):
1010
# SourcePackageReleaseDscBinariesUpdater leaves correct dsc_binaries
1012
LaunchpadZopelessLayer.switchDbUser('testadmin')
1013
spr_one = self.factory.makeSourcePackageRelease(dsc_binaries="one")
1014
spr_three = self.factory.makeSourcePackageRelease(
1015
dsc_binaries="one, two, three")
1016
transaction.commit()
1018
self.assertEqual("one", spr_one.dsc_binaries)
1019
self.assertEqual("one, two, three", spr_three.dsc_binaries)
1021
def test_SourcePackageReleaseDscBinariesUpdater_skips_broken(self):
1022
# There have been a few instances of Binary fields in PPA packages
1023
# that are formatted like a dependency relationship field, complete
1024
# with (>= ...). This is completely invalid (and failed to build),
1025
# but does exist historically, so we have to deal with it.
1026
# SourcePackageReleaseDscBinariesUpdater leaves such fields well
1028
LaunchpadZopelessLayer.switchDbUser('testadmin')
1029
spr = self.factory.makeSourcePackageRelease(
1030
dsc_binaries="one (>= 1), two")
1031
transaction.commit()
1033
self.assertEqual("one (>= 1), two", spr.dsc_binaries)
1000
1036
class TestGarboTasks(TestCaseWithFactory):
1001
1037
layer = LaunchpadZopelessLayer