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 make_policy(accepted_type): policy = AbstractUploadPolicy() policy.accepted_type = accepted_type return policy
def test_setDistroSeriesAndPocket_distro_not_found(self): policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() self.assertRaises(NotFoundError, policy.setDistroSeriesAndPocket, 'nonexistent_security')
def __init__(self): AbstractUploadPolicy.__init__(self) # We require the changes to be signed but not the dsc self.unsigned_dsc_ok = True
def __init__(self): AbstractUploadPolicy.__init__(self) # We require the changes to be signed but not the dsc or buildinfo self.unsigned_dsc_ok = True self.unsigned_buildinfo_ok = True
def test_setDistroSeriesAndPocket_distro_not_found(self): policy = AbstractUploadPolicy() policy.distro = self.factory.makeDistribution() self.assertRaises( NotFoundError, policy.setDistroSeriesAndPocket, 'nonexistent_security')