Пример #1
0
def distributionSourcePackageSetUp(test):
    """Setup the `IDistributionSourcePackage` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['bugtarget'] = ubuntu.getSourcePackage('mozilla-firefox')
    test.globs['filebug'] = bugtarget_filebug
    test.globs['question_target'] = test.globs['bugtarget']
Пример #2
0
def distributionSeriesSetUp(test):
    """Setup the `IDistroSeries` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['bugtarget'] = ubuntu.getSeries('hoary')
    test.globs['filebug'] = distroseries_filebug
    test.globs['question_target'] = ubuntu
Пример #3
0
def productSeriesSetUp(test):
    """Setup the `IProductSeries` test."""
    setUp(test)
    firefox = getUtility(IProductSet).getByName('firefox')
    test.globs['bugtarget'] = firefox.getSeries('trunk')
    test.globs['filebug'] = productseries_filebug
    test.globs['question_target'] = firefox
Пример #4
0
def distributionSourcePackageSetUp(test):
    """Setup the `IDistributionSourcePackage` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['bugtarget'] = ubuntu.getSourcePackage('mozilla-firefox')
    test.globs['filebug'] = bugtarget_filebug
    test.globs['question_target'] = test.globs['bugtarget']
Пример #5
0
def distributionSeriesSetUp(test):
    """Setup the `IDistroSeries` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['bugtarget'] = ubuntu.getSeries('hoary')
    test.globs['filebug'] = distroseries_filebug
    test.globs['question_target'] = ubuntu
Пример #6
0
def sourcePackageSetUp(test):
    """Setup the `ISourcePackage` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    warty = ubuntu.getSeries('warty')
    test.globs['bugtarget'] = warty.getSourcePackage('mozilla-firefox')
    test.globs['filebug'] = sourcepackage_filebug
    test.globs['question_target'] = ubuntu.getSourcePackage('mozilla-firefox')
Пример #7
0
def sourcePackageSetUp(test):
    """Setup the `ISourcePackage` test."""
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    warty = ubuntu.getSeries('warty')
    test.globs['bugtarget'] = warty.getSourcePackage('mozilla-firefox')
    test.globs['filebug'] = sourcepackage_filebug
    test.globs['question_target'] = ubuntu.getSourcePackage('mozilla-firefox')
Пример #8
0
def productSetUp(test):
    """Test environment for product."""
    setUp(test)
    thunderbird = getUtility(IProductSet).getByName('thunderbird')
    test.globs['target'] = thunderbird
    test.globs['collection'] = thunderbird
    login('*****@*****.**')
    test.globs['newFAQ'] = thunderbird.newFAQ
    login(ANONYMOUS)
Пример #9
0
def distributionSetUp(test):
    """Test environment for distribution."""
    setUp(test)
    kubuntu = getUtility(IDistributionSet).getByName('kubuntu')
    test.globs['target'] = kubuntu
    test.globs['collection'] = kubuntu
    login('*****@*****.**')
    test.globs['newFAQ'] = kubuntu.newFAQ
    login(ANONYMOUS)
Пример #10
0
def bugLinkedToQuestionSetUp(test):
    """Setup the question and linked bug for testing."""

    def get_bugtask_linked_to_question():
        return getUtility(IBugTaskSet).get(bugtask_id)

    setUp(test)
    bugtask_id = _createUbuntuBugTaskLinkedToQuestion()
    test.globs["get_bugtask_linked_to_question"] = get_bugtask_linked_to_question
    # Log in here, since we don't want to set up an non-anonymous
    # interaction in the test.
    login("*****@*****.**")
Пример #11
0
def bugLinkedToQuestionSetUp(test):
    """Setup the question and linked bug for testing."""
    def get_bugtask_linked_to_question():
        return getUtility(IBugTaskSet).get(bugtask_id)

    setUp(test)
    bugtask_id = _createUbuntuBugTaskLinkedToQuestion()
    test.globs['get_bugtask_linked_to_question'] = (
        get_bugtask_linked_to_question)
    # Log in here, since we don't want to set up an non-anonymous
    # interaction in the test.
    login('*****@*****.**')
Пример #12
0
def uploaderBugsSetUp(test):
    """Set up a test suite using the 'uploader' db user.

    Some aspects of the bug tracker are being used by the Soyuz uploader.
    In order to test that these functions work as expected from the uploader,
    we run them using the same db user used by the uploader.
    """
    lobotomize_stevea()
    test_dbuser = config.uploader.dbuser
    switch_dbuser(test_dbuser)
    setUp(test)
    test.globs['test_dbuser'] = test_dbuser
Пример #13
0
def projectSetUp(test):
    """Test environment for project."""
    setUp(test)
    gnome_project = getUtility(IProjectGroupSet).getByName('gnome')
    products_queue = list(gnome_project.products)

    def newFAQ(owner, title, content, keywords=None, date_created=None):
        """Create a new FAQ on each project's product in turn."""
        product = products_queue.pop(0)
        products_queue.append(product)
        return product.newFAQ(
            owner, title, content, keywords=keywords,
            date_created=date_created)

    test.globs['collection'] = gnome_project
    test.globs['newFAQ'] = newFAQ
Пример #14
0
def test_suite():
    suite = unittest.TestSuite()
    loader = unittest.TestLoader()
    suite.addTest(loader.loadTestsFromTestCase(TestEmailObfuscated))
    suite.addTest(
        LayeredDocFileSuite('question-subscribe_me.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=DatabaseFunctionalLayer))
    suite.addTest(
        LayeredDocFileSuite('views.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=DatabaseFunctionalLayer))
    suite.addTest(
        LayeredDocFileSuite('faq-views.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=DatabaseFunctionalLayer))
    return suite
Пример #15
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(
        LayeredDocFileSuite('bugzilla-xmlrpc-transport.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=LaunchpadFunctionalLayer))
    suite.addTest(
        LayeredDocFileSuite('bugzilla-api-xmlrpc-transport.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=LaunchpadFunctionalLayer))
    suite.addTest(
        LayeredDocFileSuite('trac-xmlrpc-transport.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=LaunchpadFunctionalLayer))
    suite.addTest(
        LayeredDocFileSuite('externalbugtracker-xmlrpc-transport.txt',
                            setUp=lambda test: setUp(test, future=True),
                            tearDown=tearDown,
                            layer=LaunchpadFunctionalLayer))

    return suite
Пример #16
0
def test_suite():
    suite = unittest.TestSuite()

    stories_dir = os.path.join(os.path.pardir, 'stories')
    suite.addTest(
        PageTestSuite(stories_dir,
                      setUp=lambda test: setUpGlobs(test, future=True)))
    stories_path = os.path.join(here, stories_dir)
    for story_entry in scandir.scandir(stories_path):
        if not story_entry.is_dir():
            continue
        story_path = os.path.join(stories_dir, story_entry.name)
        suite.addTest(
            PageTestSuite(story_path,
                          setUp=lambda test: setUpGlobs(test, future=True)))

    testsdir = os.path.abspath(
        os.path.normpath(os.path.join(here, os.path.pardir, 'doc')))

    # Add special needs tests
    for key in sorted(special):
        special_suite = special[key]
        suite.addTest(special_suite)

    # Add tests using default setup/teardown
    filenames = [
        filename for filename in os.listdir(testsdir)
        if filename.endswith('.txt') and filename not in special
    ]
    # Sort the list to give a predictable order.
    filenames.sort()
    for filename in filenames:
        path = os.path.join('../doc/', filename)
        one_test = LayeredDocFileSuite(
            path,
            setUp=lambda test: setUp(test, future=True),
            tearDown=tearDown,
            layer=LaunchpadFunctionalLayer,
            stdout_logging_level=logging.WARNING)
        suite.addTest(one_test)

    return suite
Пример #17
0
def test_suite():
    suite = unittest.TestSuite()
    testsdir = os.path.abspath(here)

    # Add tests using default setup/teardown
    filenames = [filename
                 for filename in os.listdir(testsdir)
                 if filename.endswith('.txt')]
    # Sort the list to give a predictable order.
    filenames.sort()
    for filename in filenames:
        path = filename
        one_test = LayeredDocFileSuite(
            path,
            setUp=lambda test: setUp(test, future=True), tearDown=tearDown,
            layer=LaunchpadFunctionalLayer,
            stdout_logging_level=logging.WARNING)
        suite.addTest(one_test)

    return suite
Пример #18
0
def bugtaskExpirationSetUp(test):
    """Setup globs for bug expiration."""
    setUp(test)
    login("*****@*****.**")
Пример #19
0
def noPrivSetUp(test):
    """Set up a test logged in as no-priv."""
    setUp(test)
    login("*****@*****.**")
Пример #20
0
def cveSetUp(test):
    lobotomize_stevea()
    switch_dbuser(config.cveupdater.dbuser)
    setUp(test)
def distroSeriesSourcePackageSetUp(test):
    setUp(test)
    test.globs['target'] = (
        getUtility(IDistributionSet).getByName('ubuntu').getSeries('hoary'))
    test.globs['filebug'] = distroseries_sourcepackage_filebug
def milestoneSetUp(test):
    setUp(test)
    firefox = getUtility(IProductSet).getByName('firefox')
    test.globs['target'] = firefox.getMilestone('1.0')
    test.globs['filebug'] = milestone_filebug
def distributionSetUp(test):
    setUp(test)
    test.globs['target'] = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['filebug'] = bugtarget_filebug
def productSetUp(test):
    setUp(test)
    test.globs['target'] = getUtility(IProductSet).getByName('firefox')
    test.globs['filebug'] = bugtarget_filebug
def distributionSourcePackageSetUp(test):
    setUp(test)
    ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['target'] = ubuntu.getSourcePackage('evolution')
    test.globs['other_target'] = ubuntu.getSourcePackage('pmount')
    test.globs['filebug'] = bugtarget_filebug
Пример #26
0
def updateRemoteProductSetup(test):
    """Setup to use the 'updateremoteproduct' db user."""
    setUp(test)
    switch_dbuser(config.updateremoteproduct.dbuser)
Пример #27
0
def statisticianSetUp(test):
    test_dbuser = config.statistician.dbuser
    test.globs['test_dbuser'] = test_dbuser
    switch_dbuser(test_dbuser)
    setUp(test)
Пример #28
0
def distributionSetUp(test):
    """Setup the `IDistribution` test."""
    setUp(test)
    test.globs['bugtarget'] = getUtility(IDistributionSet).getByName('ubuntu')
    test.globs['filebug'] = bugtarget_filebug
    test.globs['question_target'] = test.globs['bugtarget']
Пример #29
0
def uploaderSetUp(test):
    """setup the package uploader script tests."""
    setUp(test)
    switch_dbuser('uploader')
Пример #30
0
def projectSetUp(test):
    """Setup the `IProjectGroup` test."""
    setUp(test)
    projectgroups = getUtility(IProjectGroupSet)
    test.globs['bugtarget'] = projectgroups.getByName('mozilla')
    test.globs['filebug'] = project_filebug
Пример #31
0
def uploadQueueSetUp(test):
    lobotomize_stevea()
    test_dbuser = config.uploadqueue.dbuser
    switch_dbuser(test_dbuser)
    setUp(test)
    test.globs['test_dbuser'] = test_dbuser
Пример #32
0
def checkwatchesSetUp(test):
    """Setup the check watches script tests."""
    setUp(test)
    switch_dbuser(config.checkwatches.dbuser)
Пример #33
0
def branchscannerSetUp(test):
    """Setup the user for the branch scanner tests."""
    switch_dbuser("branchscanner")
    setUp(test)
Пример #34
0
def bugNotificationSendingSetUp(test):
    lobotomize_stevea()
    switch_dbuser(config.malone.bugnotification_dbuser)
    setUp(test)
Пример #35
0
def bugSetStatusSetUp(test):
    setUp(test)
    test.globs["test_dbuser"] = config.processmail.dbuser
Пример #36
0
def projectSetUp(test):
    """Setup the `IProjectGroup` test."""
    setUp(test)
    projectgroups = getUtility(IProjectGroupSet)
    test.globs['bugtarget'] = projectgroups.getByName('mozilla')
    test.globs['filebug'] = project_filebug
Пример #37
0
def productSetUp(test):
    """Setup the `IProduct` test."""
    setUp(test)
    test.globs['bugtarget'] = getUtility(IProductSet).getByName('firefox')
    test.globs['filebug'] = bugtarget_filebug
    test.globs['question_target'] = test.globs['bugtarget']
Пример #38
0
def bugmessageSetUp(test):
    setUp(test)
    login("*****@*****.**")
Пример #39
0
def hwdbDeviceTablesSetup(test):
    setUp(test)
    switch_dbuser('hwdb-submission-processor')
Пример #40
0
def lobotomizeSteveASetUp(test):
    """Call lobotomize_stevea() and standard setUp"""
    lobotomize_stevea()
    setUp(test)