def test_setDistroSeriesAndPocket_honours_aliases(self): # setDistroSeriesAndPocket honours uploads to the development series # alias, if set. policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() series = self.factory.makeDistroSeries(distribution=policy.distro, status=SeriesStatus.DEVELOPMENT) self.assertRaises(NotFoundError, policy.setDistroSeriesAndPocket, "devel") with person_logged_in(policy.distro.owner): policy.distro.development_series_alias = "devel" policy.setDistroSeriesAndPocket("devel") self.assertEqual(series, policy.distroseries)
def test_setDistroSeriesAndPocket_honours_aliases(self): # setDistroSeriesAndPocket honours uploads to the development series # alias, if set. policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() series = self.factory.makeDistroSeries( distribution=policy.distro, status=SeriesStatus.DEVELOPMENT) self.assertRaises( NotFoundError, policy.setDistroSeriesAndPocket, "devel") with person_logged_in(policy.distro.owner): policy.distro.development_series_alias = "devel" policy.setDistroSeriesAndPocket("devel") self.assertEqual(series, policy.distroseries)
def test_setDistroSeriesAndPocket_distro_not_found(self): policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() self.assertRaises(NotFoundError, policy.setDistroSeriesAndPocket, 'nonexistent_security')
def test_setDistroSeriesAndPocket_distro_not_found(self): policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() self.assertRaises( NotFoundError, policy.setDistroSeriesAndPocket, 'nonexistent_security')