def setUp(self): TestCaseWithFactory.setUp(self) self.owner = self.factory.makePerson() self.product = self.factory.makeProduct(name='bonkers', displayname='Bonkers', owner=self.owner) self.obsolete_productseries = self.factory.makeProductSeries( name='obsolete', product=self.product) with person_logged_in(self.product.owner): self.obsolete_productseries.status = SeriesStatus.OBSOLETE self.dev_productseries = self.factory.makeProductSeries( name='current', product=self.product) with person_logged_in(self.product.owner): self.dev_productseries.status = SeriesStatus.DEVELOPMENT self.distribution = self.factory.makeDistribution( name='youbuntu', displayname='Youbuntu', owner=self.owner) self.distroseries = self.factory.makeDistroSeries( name='busy', distribution=self.distribution) self.sourcepackagename = self.factory.makeSourcePackageName( name='bonkers') self.package = self.factory.makeSourcePackage( sourcepackagename=self.sourcepackagename, distroseries=self.distroseries)
def setUp(self): """Create the Soyuz test publisher.""" TestCaseWithFactory.setUp(self) self.stp = SoyuzTestPublisher() self.stp.prepareBreezyAutotest() self.test_package_name = u"accept-test" self.distro = self.factory.makeDistribution()
def setUp(self): # Use an administrator to set branch privacy easily. TestCaseWithFactory.setUp(self, "*****@*****.**") # Exclude sample data from the test results. IStore(RevisionCache).execute( "UPDATE Revision SET karma_allocated = TRUE " "WHERE karma_allocated IS FALSE")
def setUp(self): TestCaseWithFactory.setUp(self) self.user = self.factory.makePerson(name="macadamia") login_person(self.user) # Use a FakeLogger fixture to prevent Memcached warnings to be # printed to stdout while browsing pages. self.useFixture(FakeLogger())
def setUp(self): # Login with admin roles as we aren't testing access here. TestCaseWithFactory.setUp(self, '*****@*****.**') import_public_test_keys() # Ensure that tests will try to fetch keys from the keyserver. self.useFixture(KeyServerTac()) getUtility(IGPGHandler).resetLocalState()
def setUp(self): TestCaseWithFactory.setUp(self) self.builder = self.factory.makeBuilder() self.build = self.factory.makeSourcePackageRecipeBuild() self.buildqueue = self.build.queueBuild() self.buildqueue.markAsBuilding(self.builder) self.slave = OkSlave()
def setUp(self): """Make a PPA and publish some sources that need builds.""" TestCaseWithFactory.setUp(self) self.stp = SoyuzTestPublisher() self.stp.prepareBreezyAutotest() # i386 and hppa are enabled by STP but we need to mark hppa as # PPA-enabled. self.stp.breezy_autotest_hppa.supports_virtualized = True # Create an arch-any and an arch-all source in a PPA. self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA, distribution=self.stp.ubuntutest) self.all = self.stp.getPubSource( sourcename="all", architecturehintlist="all", archive=self.ppa, status=PackagePublishingStatus.PUBLISHED) self.any = self.stp.getPubSource( sourcename="any", architecturehintlist="any", archive=self.ppa, status=PackagePublishingStatus.PUBLISHED) self.required_arches = [ self.stp.breezy_autotest_hppa, self.stp.breezy_autotest_i386 ]
def setUp(self): TestCaseWithFactory.setUp(self) self.owner = self.factory.makePerson() self.product = self.factory.makeProduct( name='bonkers', displayname='Bonkers', owner=self.owner) self.obsolete_productseries = self.factory.makeProductSeries( name='obsolete', product=self.product) with person_logged_in(self.product.owner): self.obsolete_productseries.status = SeriesStatus.OBSOLETE self.dev_productseries = self.factory.makeProductSeries( name='current', product=self.product) with person_logged_in(self.product.owner): self.dev_productseries.status = SeriesStatus.DEVELOPMENT self.distribution = self.factory.makeDistribution( name='youbuntu', displayname='Youbuntu', owner=self.owner) self.distroseries = self.factory.makeDistroSeries( name='busy', distribution=self.distribution) self.sourcepackagename = self.factory.makeSourcePackageName( name='bonkers') self.package = self.factory.makeSourcePackage( sourcepackagename=self.sourcepackagename, distroseries=self.distroseries)
def setUp(self): TestCaseWithFactory.setUp(self) login('[email protected] ') self.person = self.factory.makePerson( name='test-person', displayname='Test Person') self.webservice = LaunchpadWebServiceCaller( 'launchpad-library', 'salgado-change-anything')
def setUp(self): TestCaseWithFactory.setUp(self) self.claimer = self.factory.makePerson(name='claimer') self.claimee_email = '*****@*****.**' self.claimee = self.factory.makePerson( name='claimee', email=self.claimee_email, email_address_status=EmailAddressStatus.NEW)
def setUp(self): TestCaseWithFactory.setUp(self) self.root = getUtility(ILaunchpadRoot) self.admin = getUtility(IPersonSet).getByEmail('*****@*****.**') # Use a FakeLogger fixture to prevent Memcached warnings to be # printed to stdout while browsing pages. self.useFixture(FakeLogger())
def setUp(self): TestCaseWithFactory.setUp(self) self.packaging_util = getUtility(IPackagingUtil) self.sourcepackagename = self.factory.makeSourcePackageName('sparkle') self.distroseries = self.factory.makeDistroSeries(name='dazzle') self.productseries = self.factory.makeProductSeries(name='glitter') self.owner = self.productseries.product.owner
def setUp(self): TestCaseWithFactory.setUp(self) login('[email protected] ') self.person = self.factory.makePerson(name='test-person', displayname='Test Person') self.webservice = LaunchpadWebServiceCaller('launchpad-library', 'salgado-change-anything')
def setUp(self): # Create a productseries that uses translations. TestCaseWithFactory.setUp(self) product = self.factory.makeProduct( translations_usage=ServiceUsage.LAUNCHPAD) self.productseries = self.factory.makeProductSeries( product=product)
def setUp(self): TestCaseWithFactory.setUp(self) self.root = getUtility(ILaunchpadRoot) self.admin = getUtility(IPersonSet).getByEmail( '*****@*****.**') # Use a FakeLogger fixture to prevent Memcached warnings to be # printed to stdout while browsing pages. self.useFixture(FakeLogger())
def setUp(self): # Log in a VCS Imports member. TestCaseWithFactory.setUp(self, '*****@*****.**') self.import_operator = getUtility(IPersonSet).getByEmail( '*****@*****.**') # Remove existing jobs. for job in CodeImportJob.select(): job.destroySelf()
def setUp(self): # Use an administrator to set branch privacy easily. TestCaseWithFactory.setUp(self, "*****@*****.**") # Since the tests order by date, but also limit to the last 30 # days, we want a time counter that starts 10 days ago. self.date_generator = time_counter(datetime.now(pytz.UTC) - timedelta(days=10), delta=timedelta(days=1))
def setUp(self): # Use an administrator to set branch privacy easily. TestCaseWithFactory.setUp(self, "*****@*****.**") # Since the tests order by date, but also limit to the last 30 # days, we want a time counter that starts 10 days ago. self.date_generator = time_counter( datetime.now(pytz.UTC) - timedelta(days=10), delta=timedelta(days=1))
def setUp(self): # Create a productseries that uses translations. TestCaseWithFactory.setUp(self) product = self.factory.makeProduct( translations_usage=ServiceUsage.LAUNCHPAD) self.productseries = self.factory.makeProductSeries(product=product) self.psl_set = getUtility(IProductSeriesLanguageSet) self.language = getUtility(ILanguageSet).getLanguageByCode('sr')
def setUp(self): TestCaseWithFactory.setUp(self, '*****@*****.**') source = self.factory.makeProductBranch(title='source-branch') target = self.factory.makeProductBranch( product=source.product, title='target-branch') self.bmp = source.addLandingTarget(source.owner, target) self.submitter = self.factory.makePerson() self.reviewer = self.factory.makePerson() self.bmp2 = self.factory.makeBranchMergeProposal()
def setUp(self): TestCaseWithFactory.setUp(self) self.distribution = self.factory.makeDistribution(name='ibuntu') self.series = [ self.factory.makeDistroSeries(name="feasty", version='9.04'), ] self.entries = SourcesListEntries( self.distribution, 'http://example.com/my/archive', self.series)
def setUp(self): # Login with admin roles as we aren't testing access here. TestCaseWithFactory.setUp(self, '*****@*****.**') self._log_output = StringIO() handler = logging.StreamHandler(self._log_output) logger = logging.getLogger('mail-authenticate-dkim') logger.addHandler(handler) self.addCleanup(lambda: logger.removeHandler(handler)) self.monkeypatch_dns()
def setUp(self): TestCaseWithFactory.setUp(self) self.distribution = self.factory.makeDistribution(name='ibuntu') self.series = [ self.factory.makeDistroSeries(name="feasty", version='9.04'), ] self.entries = SourcesListEntries(self.distribution, 'http://example.com/my/archive', self.series)
def setUp(self): TestCaseWithFactory.setUp(self) self.product = self.factory.makeProduct() self.db_branch = self.factory.makeProductBranch(product=self.product) # Replace the built-in merge_detected with our test stub. self._original_merge_detected = mergedetection.merge_detected mergedetection.merge_detected = self.mergeDetected # Reset the recorded branches. self.merges = []
def setUp(self): # Create a productseries that uses translations. TestCaseWithFactory.setUp(self) product = self.factory.makeProduct( translations_usage=ServiceUsage.LAUNCHPAD) self.productseries = self.factory.makeProductSeries( product=product) self.psl_set = getUtility(IProductSeriesLanguageSet) self.language = getUtility(ILanguageSet).getLanguageByCode('sr')
def setUp(self): TestCaseWithFactory.setUp(self) login(ADMIN_EMAIL) # Make two bugs, one whose description points to the other, so it will # get turned into a HTML link. self.bug_one = self.factory.makeBug(title="generic") self.bug_two = self.factory.makeBug( description="Useless bugs are useless. See Bug %d." % ( self.bug_one.id)) self.webservice = LaunchpadWebServiceCaller( 'launchpad-library', 'salgado-change-anything')
def setUp(self): TestCaseWithFactory.setUp(self) login(ADMIN_EMAIL) # Make two bugs, one whose description points to the other, so it will # get turned into a HTML link. self.bug_one = self.factory.makeBug(title="generic") self.bug_two = self.factory.makeBug( description="Useless bugs are useless. See Bug %d." % (self.bug_one.id)) self.webservice = LaunchpadWebServiceCaller('launchpad-library', 'salgado-change-anything')
def setUp(self): TestCaseWithFactory.setUp(self) # Make a distro with some series, a source package name, and a distro # source package. self.distro = self.factory.makeDistribution() for version in ("1.0", "2.0", "3.0"): self.factory.makeDistroSeries(distribution=self.distro, version=version) self.sourcepackagename = self.factory.makeSourcePackageName() self.distro_source_package = ( self.factory.makeDistributionSourcePackage( distribution=self.distro, sourcepackagename=self.sourcepackagename))
def setUp(self): # Create a distroseries that uses translations. TestCaseWithFactory.setUp(self) self.distroseries = self.factory.makeDistroSeries() self.language = getUtility(ILanguageSet).getLanguageByCode('sr') sourcepackagename = self.factory.makeSourcePackageName() potemplate = self.factory.makePOTemplate( distroseries=self.distroseries, sourcepackagename=sourcepackagename) self.factory.makePOFile('sr', potemplate) self.distroseries.updateStatistics(transaction) self.dsl = self.distroseries.distroserieslanguages[0] self.view = DistroSeriesLanguageView(self.dsl, LaunchpadTestRequest())
def setUp(self): TestCaseWithFactory.setUp(self) # Make a distro with some series, a source package name, and a distro # source package. self.distro = self.factory.makeDistribution() for version in ("1.0", "2.0", "3.0"): self.factory.makeDistroSeries( distribution=self.distro, version=version) self.sourcepackagename = self.factory.makeSourcePackageName() self.distro_source_package = ( self.factory.makeDistributionSourcePackage( distribution=self.distro, sourcepackagename=self.sourcepackagename))
def setUp(self): TestCaseWithFactory.setUp(self) self.request = LaunchpadTestRequest() # We create an account without a Person here just to make sure the # person and account created later don't end up with the same IDs, # which could happen since they're both sequential. # We need them to be different for one of our tests here. getUtility(IAccountSet).new( AccountCreationRationale.UNKNOWN, 'Dummy name') person = self.factory.makePerson('*****@*****.**') self.assertNotEqual(person.id, person.account.id) self.principal = LaunchpadPrincipal( person.account.id, person.displayname, person.displayname, person)
def setUp(self): # Create a distroseries that uses translations. TestCaseWithFactory.setUp(self) self.distroseries = self.factory.makeDistroSeries() self.language = getUtility(ILanguageSet).getLanguageByCode('sr') sourcepackagename = self.factory.makeSourcePackageName() potemplate = self.factory.makePOTemplate( distroseries=self.distroseries, sourcepackagename=sourcepackagename) self.factory.makePOFile('sr', potemplate) self.distroseries.updateStatistics(transaction) self.dsl = self.distroseries.distroserieslanguages[0] self.view = DistroSeriesLanguageView( self.dsl, LaunchpadTestRequest())
def setUp(self): TestCaseWithFactory.setUp(self) self.request = LaunchpadTestRequest() # We create an account without a Person here just to make sure the # person and account created later don't end up with the same IDs, # which could happen since they're both sequential. # We need them to be different for one of our tests here. getUtility(IAccountSet).new( AccountCreationRationale.UNKNOWN, 'Dummy name') person = self.factory.makePerson('*****@*****.**') self.failIfEqual(person.id, person.account.id) self.principal = LaunchpadPrincipal( person.account.id, person.displayname, person.displayname, person)
def setUp(self): TestCaseWithFactory.setUp(self) self.distribution = self.factory.makeDistribution(name='ibuntu') # Ensure there is only one series available. self.series = [ self.factory.makeDistroSeries(name="feasty", version='9.04'), ] self.entries = SourcesListEntries( self.distribution, 'http://example.com/my/archive', self.series) self.view = SourcesListEntriesView( self.entries, LaunchpadTestRequest()) self.view.initialize()
def setUp(self): TestCaseWithFactory.setUp(self) login('[email protected] ') self.bug = self.factory.makeBug() commenter = self.factory.makePerson() self.bug.newMessage(commenter, 'Comment Subject', 'Comment content') comments = get_comments_for_bugtask(self.bug.bugtasks[0]) self.comment = comments[1] comment_view = getMultiAdapter((self.comment, LaunchpadTestRequest()), name="+box") self.expected_comment_html = str(comment_view()) self.message_path = '/%s/+bug/%s/comments/1' % ( self.bug.bugtasks[0].product.name, self.bug.id) self.webservice = LaunchpadWebServiceCaller('launchpad-library', 'salgado-change-anything')
def setUp(self): TestCaseWithFactory.setUp(self) self.distribution = self.factory.makeDistribution(name='ibuntu') # Ensure there is only one series available. self.series = [ self.factory.makeDistroSeries(name="feasty", version='9.04'), ] self.entries = SourcesListEntries(self.distribution, 'http://example.com/my/archive', self.series) self.view = SourcesListEntriesView(self.entries, LaunchpadTestRequest()) self.view.initialize()
def setUp(self): TestCaseWithFactory.setUp(self) public_branch = self.factory.makeAnyBranch(name='public') self.queue_with_public_branch = self.factory.makeBranchMergeQueue( branches=[removeSecurityProxy(public_branch)]) private_branch1 = self.factory.makeAnyBranch( name='private1', information_type=InformationType.USERDATA) naked_private_branch1 = removeSecurityProxy(private_branch1) self.private_branch1_owner = naked_private_branch1.owner self.queue1_with_private_branch = self.factory.makeBranchMergeQueue( branches=[naked_private_branch1]) private_branch2 = self.factory.makeAnyBranch( name='private2', information_type=InformationType.USERDATA) self.queue2_with_private_branch = self.factory.makeBranchMergeQueue( branches=[removeSecurityProxy(private_branch2)]) self.all_queues = getUtility(IAllBranchMergeQueues)
def setUp(self): TestCaseWithFactory.setUp(self) login('[email protected] ') self.bug = self.factory.makeBug() commenter = self.factory.makePerson() self.bug.newMessage( commenter, 'Comment Subject', 'Comment content') comments = get_comments_for_bugtask(self.bug.bugtasks[0]) self.comment = comments[1] comment_view = getMultiAdapter( (self.comment, LaunchpadTestRequest()), name="+box") self.expected_comment_html = str(comment_view()) self.message_path = '/%s/+bug/%s/comments/1' % ( self.bug.bugtasks[0].product.name, self.bug.id) self.webservice = LaunchpadWebServiceCaller( 'launchpad-library', 'salgado-change-anything')
def setUp(self): TestCaseWithFactory.setUp(self) self.user = self.factory.makePerson() login_person(self.user) self.barney = self.factory.makePerson(name='barney') self.bambam = self.factory.makeProduct(name='bambam') time_gen = time_counter(delta=timedelta(days=-1)) self.branches = [ self.factory.makeProductBranch( product=self.bambam, owner=self.barney, date_created=time_gen.next()) for i in range(10)] self.bug = self.factory.makeBug() self.bug.linkBranch(self.branches[0], self.barney) self.spec = self.factory.makeSpecification() self.spec.linkBranch(self.branches[1], self.barney)
def setUp(self): TestCaseWithFactory.setUp(self) login('*****@*****.**') self.sourcepackagename = self.factory.makeSourcePackageName() # Set up productseries. self.person = self.factory.makePerson() self.product = self.factory.makeProduct(owner=self.person) self.dev_focus = self.product.development_focus self.product_series = self.factory.makeProductSeries(self.product) # Set up distroseries. self.distroseries_set = getUtility(IDistroSeriesSet) self.distribution_set = getUtility(IDistributionSet) self.ubuntu = self.distribution_set.getByName("ubuntu") self.debian = self.distribution_set.getByName("debian") self.ubuntu_series = self.factory.makeDistroSeries(self.ubuntu) self.debian_series = self.factory.makeDistroSeries(self.debian)
def setUp(self): TestCaseWithFactory.setUp(self) self.user = self.factory.makePerson() login_person(self.user) self.barney = self.factory.makePerson(name='barney') self.bambam = self.factory.makeProduct(name='bambam') time_gen = time_counter(delta=timedelta(days=-1)) self.branches = [ self.factory.makeProductBranch(product=self.bambam, owner=self.barney, date_created=time_gen.next()) for i in range(10) ] self.bug = self.factory.makeBug() self.bug.linkBranch(self.branches[0], self.barney) self.spec = self.factory.makeSpecification() self.spec.linkBranch(self.branches[1], self.barney)
def setUp(self): """Make a PPA and publish some sources that need builds.""" TestCaseWithFactory.setUp(self) self.stp = SoyuzTestPublisher() self.stp.prepareBreezyAutotest() # i386 and hppa are enabled by STP but we need to mark hppa as # PPA-enabled. self.stp.breezy_autotest_hppa.supports_virtualized = True # Create an arch-any and an arch-all source in a PPA. self.ppa = self.factory.makeArchive( purpose=ArchivePurpose.PPA, distribution=self.stp.ubuntutest) self.all = self.stp.getPubSource( sourcename="all", architecturehintlist="all", archive=self.ppa, status=PackagePublishingStatus.PUBLISHED) self.any = self.stp.getPubSource( sourcename="any", architecturehintlist="any", archive=self.ppa, status=PackagePublishingStatus.PUBLISHED) self.required_arches = [ self.stp.breezy_autotest_hppa, self.stp.breezy_autotest_i386]
def setUp(self): TestCaseWithFactory.setUp(self) # Use the unsecured PersonSet so that private methods can be tested. self.from_person = self.factory.makePerson() self.to_person = self.factory.makePerson() self.cur = cursor()
def setUp(self): TestCaseWithFactory.setUp(self) self.team, self.mailing_list = self.factory.makeTeamAndMailingList( 'test-mailinglist', 'team-owner')
def setUp(self): TestCaseWithFactory.setUp(self) remove_all_sample_data_branches() self._branch_cloud = getUtility(IBranchCloud)
def setUp(self): TestCaseWithFactory.setUp(self) self.person = self.factory.makePerson()
def setUp(self): TestCaseWithFactory.setUp(self) private_root = getUtility(IPrivateApplication) self.authserver = AuthServerAPIView( private_root.authserver, TestRequest())
def setUp(self): TestCaseWithFactory.setUp(self) self.endpoint = FeatureFlagApplication()