~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/testing/ftests/test_layers.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-26 04:36:33 UTC
  • mfrom: (14022.4.6 dbconfig-section-doom)
  • Revision ID: launchpad@pqm.canonical.com-20110926043633-bqcr5e4eeev57o5s
[r=lifeless][no-qa] Drop DatabaseConfig's obsolete section selection
        support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    getUtility,
32
32
    )
33
33
 
34
 
from canonical.config import (
35
 
    config,
36
 
    dbconfig,
37
 
    )
 
34
from canonical.config import config
38
35
from canonical.lazr.pidfile import pidfile_path
39
36
from canonical.librarian.client import (
40
37
    LibrarianClient,
480
477
    want_memcached = True
481
478
    want_rabbitmq = True
482
479
 
483
 
    def testSwitchDbConfig(self):
484
 
        # Test that we can switch database configurations, and that we
485
 
        # end up connected as the right user.
486
 
 
487
 
        self.assertEqual(dbconfig.dbuser, 'launchpad_main')
488
 
        LaunchpadScriptLayer.switchDbConfig('librarian')
489
 
        self.assertEqual(dbconfig.dbuser, 'librarian')
490
 
 
491
 
        from canonical.database.sqlbase import cursor
492
 
        cur = cursor()
493
 
        cur.execute('SELECT current_user;')
494
 
        user = cur.fetchone()[0]
495
 
        self.assertEqual(user, 'librarian')
496
 
 
497
480
 
498
481
class LayerProcessControllerInvariantsTestCase(BaseTestCase):
499
482
    layer = AppServerLayer