1026
1026
self.runDaily()
1027
1027
self.assertEqual(0, unreferenced_msgsets.count())
1029
def test_SourcePackageReleaseDscBinariesUpdater_updates_incorrect(self):
1030
# SourcePackageReleaseDscBinariesUpdater fixes incorrectly-separated
1031
# dsc_binaries values.
1032
LaunchpadZopelessLayer.switchDbUser('testadmin')
1034
self.factory.getUniqueString(),
1035
self.factory.getUniqueString(),
1036
self.factory.getUniqueString(),
1038
spr_three = self.factory.makeSourcePackageRelease(
1039
dsc_binaries=" ".join(three))
1040
transaction.commit()
1042
self.assertEqual(", ".join(three), spr_three.dsc_binaries)
1044
def test_SourcePackageReleaseDscBinariesUpdater_skips_correct(self):
1045
# SourcePackageReleaseDscBinariesUpdater leaves correct dsc_binaries
1047
LaunchpadZopelessLayer.switchDbUser('testadmin')
1048
one = self.factory.getUniqueString()
1049
spr_one = self.factory.makeSourcePackageRelease(dsc_binaries=one)
1051
self.factory.getUniqueString(),
1052
self.factory.getUniqueString(),
1053
self.factory.getUniqueString(),
1055
spr_three = self.factory.makeSourcePackageRelease(dsc_binaries=three)
1056
transaction.commit()
1058
self.assertEqual(one, spr_one.dsc_binaries)
1059
self.assertEqual(three, spr_three.dsc_binaries)
1061
def test_SourcePackageReleaseDscBinariesUpdater_skips_broken(self):
1062
# There have been a few instances of Binary fields in PPA packages
1063
# that are formatted like a dependency relationship field, complete
1064
# with (>= ...). This is completely invalid (and failed to build),
1065
# but does exist historically, so we have to deal with it.
1066
# SourcePackageReleaseDscBinariesUpdater leaves such fields well
1068
LaunchpadZopelessLayer.switchDbUser('testadmin')
1069
broken = "%s (>= 1), %s" % (
1070
self.factory.getUniqueString(), self.factory.getUniqueString())
1071
spr_broken = self.factory.makeSourcePackageRelease(
1072
dsc_binaries=broken)
1073
transaction.commit()
1075
self.assertEqual(broken, spr_broken.dsc_binaries)
1030
1078
class TestGarboTasks(TestCaseWithFactory):
1031
1079
layer = LaunchpadZopelessLayer