def test_finds_newer_release_even_when_same_release_also_exists(self):
     dsp = self.makeDerivedDistroSeries()
     derived_series = dsp.derived_series
     parent_series = dsp.parent_series
     spn = self.factory.makeSourcePackageName()
     shared_spr = self.factory.makeSourcePackageRelease(
         distroseries=parent_series, sourcepackagename=spn)
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=shared_spr)
     self.makeSPPH(
         distroseries=derived_series,
         sourcepackagerelease=shared_spr)
     newer_spr = self.factory.makeSourcePackageRelease(
         distroseries=derived_series, sourcepackagename=spn)
     self.makeSPPH(
         distroseries=derived_series, sourcepackagerelease=newer_spr)
     query = compose_sql_find_differences(derived_series, parent_series)
     self.assertContentEqual(
         [(
             parent_spph.sourcepackagerelease.sourcepackagenameID,
             newer_spr.version,
             shared_spr.version,
         )],
         Store.of(derived_series).execute(query))
 def test_finds_newer_release_even_when_same_release_also_exists(self):
     dsp = self.makeDerivedDistroSeries()
     derived_series = dsp.derived_series
     parent_series = dsp.parent_series
     spn = self.factory.makeSourcePackageName()
     shared_spr = self.factory.makeSourcePackageRelease(
         distroseries=parent_series, sourcepackagename=spn)
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=shared_spr)
     self.makeSPPH(
         distroseries=derived_series,
         sourcepackagerelease=shared_spr)
     newer_spr = self.factory.makeSourcePackageRelease(
         distroseries=derived_series, sourcepackagename=spn)
     self.makeSPPH(
         distroseries=derived_series, sourcepackagerelease=newer_spr)
     query = compose_sql_find_differences(derived_series, parent_series)
     self.assertContentEqual(
         [(
             parent_spph.sourcepackagerelease.sourcepackagenameID,
             newer_spr.version,
             shared_spr.version,
         )],
         Store.of(derived_series).execute(query))
Exemplo n.º 3
0
 def test_finds_releases_for_same_version(self):
     dsp = self.makeDerivedDistroSeries()
     derived_series = dsp.derived_series
     version_string = self.factory.getUniqueString()
     parent_series = dsp.parent_series
     package = self.factory.makeSourcePackageName()
     derived_spph = self.makeSPPH(
         distroseries=derived_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             sourcepackagename=package,
             distroseries=derived_series,
             version=version_string))
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             sourcepackagename=package,
             distroseries=parent_series,
             version=version_string))
     query = compose_sql_find_differences(derived_series, parent_series)
     self.assertContentEqual([(
         package.id,
         derived_spph.sourcepackagerelease.version,
         parent_spph.sourcepackagerelease.version,
     )],
                             Store.of(derived_series).execute(query))
 def test_does_not_find_grandparents_packages(self):
     dsp = self.makeDerivedDistroSeries()
     grandparent = self.factory.makeDistroSeriesParent(
         derived_series=dsp.parent_series)
     self.makeSPPH(distroseries=grandparent.parent_series)
     query = compose_sql_find_differences(
         dsp.derived_series, dsp.parent_series)
     self.assertContentEqual(
         [], Store.of(dsp.derived_series).execute(query))
Exemplo n.º 5
0
 def test_does_not_find_grandparents_packages(self):
     dsp = self.makeDerivedDistroSeries()
     grandparent = self.factory.makeDistroSeriesParent(
         derived_series=dsp.parent_series)
     self.makeSPPH(distroseries=grandparent.parent_series)
     query = compose_sql_find_differences(dsp.derived_series,
                                          dsp.parent_series)
     self.assertContentEqual([],
                             Store.of(dsp.derived_series).execute(query))
Exemplo n.º 6
0
 def test_finds_release_unique_to_derived_series(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     spph = self.makeSPPH(distroseries=distroseries)
     query = compose_sql_find_differences(distroseries, dsp.parent_series)
     self.assertContentEqual([(
         spph.sourcepackagerelease.sourcepackagenameID,
         spph.sourcepackagerelease.version,
         None,
     )],
                             Store.of(distroseries).execute(query))
 def test_finds_release_unique_to_derived_series(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     spph = self.makeSPPH(distroseries=distroseries)
     query = compose_sql_find_differences(distroseries, dsp.parent_series)
     self.assertContentEqual(
         [(
             spph.sourcepackagerelease.sourcepackagenameID,
             spph.sourcepackagerelease.version,
             None,
         )],
         Store.of(distroseries).execute(query))
Exemplo n.º 8
0
 def test_finds_identical_releases(self):
     dsp = self.makeDerivedDistroSeries()
     spr = self.factory.makeSourcePackageRelease()
     parent_spph = self.makeSPPH(distroseries=dsp.parent_series,
                                 sourcepackagerelease=spr)
     derived_spph = self.makeSPPH(distroseries=dsp.derived_series,
                                  sourcepackagerelease=spr)
     query = compose_sql_find_differences(dsp.derived_series,
                                          dsp.parent_series)
     self.assertContentEqual([(
         spr.sourcepackagename.id,
         derived_spph.sourcepackagerelease.version,
         parent_spph.sourcepackagerelease.version,
     )],
                             Store.of(dsp.derived_series).execute(query))
 def test_finds_identical_releases(self):
     dsp = self.makeDerivedDistroSeries()
     spr = self.factory.makeSourcePackageRelease()
     parent_spph = self.makeSPPH(
         distroseries=dsp.parent_series, sourcepackagerelease=spr)
     derived_spph = self.makeSPPH(
         distroseries=dsp.derived_series, sourcepackagerelease=spr)
     query = compose_sql_find_differences(
         dsp.derived_series, dsp.parent_series)
     self.assertContentEqual(
         [(
             spr.sourcepackagename.id,
             derived_spph.sourcepackagerelease.version,
             parent_spph.sourcepackagerelease.version,
         )],
         Store.of(dsp.derived_series).execute(query))
 def test_does_not_conflate_releases_of_different_packages(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     parent_spph = self.makeSPPH(distroseries=dsp.parent_series)
     derived_spph = self.makeSPPH(distroseries=distroseries)
     query = compose_sql_find_differences(distroseries, dsp.parent_series)
     self.assertEqual(2, Store.of(distroseries).execute(query).rowcount)
     self.assertContentEqual([(
             parent_spph.sourcepackagerelease.sourcepackagenameID,
             None,
             parent_spph.sourcepackagerelease.version,
         ), (
             derived_spph.sourcepackagerelease.sourcepackagenameID,
             derived_spph.sourcepackagerelease.version,
             None,
         )],
         Store.of(distroseries).execute(query))
 def test_does_not_conflate_releases_of_different_packages(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     parent_spph = self.makeSPPH(distroseries=dsp.parent_series)
     derived_spph = self.makeSPPH(distroseries=distroseries)
     query = compose_sql_find_differences(distroseries, dsp.parent_series)
     self.assertEqual(2, Store.of(distroseries).execute(query).rowcount)
     self.assertContentEqual([(
             parent_spph.sourcepackagerelease.sourcepackagenameID,
             None,
             parent_spph.sourcepackagerelease.version,
         ), (
             derived_spph.sourcepackagerelease.sourcepackagenameID,
             derived_spph.sourcepackagerelease.version,
             None,
         )],
         Store.of(distroseries).execute(query))
Exemplo n.º 12
0
 def test_finds_different_releases_of_same_package(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     parent_series = dsp.parent_series
     spn = self.factory.makeSourcePackageName()
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             distroseries=parent_series, sourcepackagename=spn))
     derived_spph = self.makeSPPH(
         distroseries=distroseries,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             distroseries=distroseries, sourcepackagename=spn))
     query = compose_sql_find_differences(distroseries, parent_series)
     self.assertContentEqual([(
         parent_spph.sourcepackagerelease.sourcepackagenameID,
         derived_spph.sourcepackagerelease.version,
         parent_spph.sourcepackagerelease.version,
     )],
                             Store.of(distroseries).execute(query))
 def test_finds_different_releases_of_same_package(self):
     dsp = self.makeDerivedDistroSeries()
     distroseries = dsp.derived_series
     parent_series = dsp.parent_series
     spn = self.factory.makeSourcePackageName()
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             distroseries=parent_series, sourcepackagename=spn))
     derived_spph = self.makeSPPH(
         distroseries=distroseries,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             distroseries=distroseries, sourcepackagename=spn))
     query = compose_sql_find_differences(distroseries, parent_series)
     self.assertContentEqual(
         [(
             parent_spph.sourcepackagerelease.sourcepackagenameID,
             derived_spph.sourcepackagerelease.version,
             parent_spph.sourcepackagerelease.version,
         )],
         Store.of(distroseries).execute(query))
 def test_finds_releases_for_same_version(self):
     dsp = self.makeDerivedDistroSeries()
     derived_series = dsp.derived_series
     version_string = self.factory.getUniqueString()
     parent_series = dsp.parent_series
     package = self.factory.makeSourcePackageName()
     derived_spph = self.makeSPPH(
         distroseries=derived_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             sourcepackagename=package, distroseries=derived_series,
             version=version_string))
     parent_spph = self.makeSPPH(
         distroseries=parent_series,
         sourcepackagerelease=self.factory.makeSourcePackageRelease(
             sourcepackagename=package, distroseries=parent_series,
             version=version_string))
     query = compose_sql_find_differences(derived_series, parent_series)
     self.assertContentEqual(
         [(
             package.id,
             derived_spph.sourcepackagerelease.version,
             parent_spph.sourcepackagerelease.version,
         )],
         Store.of(derived_series).execute(query))
 def test_baseline(self):
     dsp = self.makeDerivedDistroSeries()
     query = compose_sql_find_differences(
         dsp.derived_series, dsp.parent_series)
     self.assertIsInstance(query, basestring)
 def test_finds_nothing_for_empty_distroseries(self):
     dsp = self.makeDerivedDistroSeries()
     query = compose_sql_find_differences(
         dsp.derived_series, dsp.parent_series)
     self.assertContentEqual(
         [], Store.of(dsp.derived_series).execute(query))
Exemplo n.º 17
0
 def test_baseline(self):
     dsp = self.makeDerivedDistroSeries()
     query = compose_sql_find_differences(dsp.derived_series,
                                          dsp.parent_series)
     self.assertIsInstance(query, basestring)
Exemplo n.º 18
0
 def test_finds_nothing_for_empty_distroseries(self):
     dsp = self.makeDerivedDistroSeries()
     query = compose_sql_find_differences(dsp.derived_series,
                                          dsp.parent_series)
     self.assertContentEqual([],
                             Store.of(dsp.derived_series).execute(query))