1030
1030
# SourcePackageReleaseDscBinariesUpdater fixes incorrectly-separated
1031
1031
# dsc_binaries values.
1032
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))
1033
spr = self.factory.makeSourcePackageRelease(
1034
dsc_binaries="one two three")
1040
1035
transaction.commit()
1041
1036
self.runDaily()
1042
self.assertEqual(", ".join(three), spr_three.dsc_binaries)
1037
self.assertEqual("one, two, three", spr.dsc_binaries)
1044
1039
def test_SourcePackageReleaseDscBinariesUpdater_skips_correct(self):
1045
1040
# SourcePackageReleaseDscBinariesUpdater leaves correct dsc_binaries
1046
1041
# values alone.
1047
1042
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)
1043
spr_one = self.factory.makeSourcePackageRelease(dsc_binaries="one")
1044
spr_three = self.factory.makeSourcePackageRelease(
1045
dsc_binaries="one, two, three")
1056
1046
transaction.commit()
1057
1047
self.runDaily()
1058
self.assertEqual(one, spr_one.dsc_binaries)
1059
self.assertEqual(three, spr_three.dsc_binaries)
1048
self.assertEqual("one", spr_one.dsc_binaries)
1049
self.assertEqual("one, two, three", spr_three.dsc_binaries)
1061
1051
def test_SourcePackageReleaseDscBinariesUpdater_skips_broken(self):
1062
1052
# There have been a few instances of Binary fields in PPA packages
1066
1056
# SourcePackageReleaseDscBinariesUpdater leaves such fields well
1068
1058
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)
1059
spr = self.factory.makeSourcePackageRelease(
1060
dsc_binaries="one (>= 1), two")
1073
1061
transaction.commit()
1074
1062
self.runDaily()
1075
self.assertEqual(broken, spr_broken.dsc_binaries)
1063
self.assertEqual("one (>= 1), two", spr.dsc_binaries)
1078
1066
class TestGarboTasks(TestCaseWithFactory):