~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/launchpad/webapp/tests/test_publication.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-21 14:28:02 UTC
  • mfrom: (14006 devel)
  • mto: This revision was merged to the branch mainline in revision 14010.
  • Revision ID: jelmer@canonical.com-20110921142802-7ggkc204igsy532w
MergeĀ lp:launchpad

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
    def test_no_mode_changes(self):
151
151
        # Make sure the master/slave stores are present in zstorm.
152
 
        self.assertIn('launchpad-main-master', self.zstorm_stores)
153
 
        self.assertIn('launchpad-main-slave', self.zstorm_stores)
 
152
        self.assertIn('main-master', self.zstorm_stores)
 
153
        self.assertIn('main-slave', self.zstorm_stores)
154
154
 
155
155
        self.publication.beforeTraversal(self.request)
156
156
 
157
157
        # Since the mode didn't change, the stores were left in zstorm.
158
 
        self.assertIn('launchpad-main-master', self.zstorm_stores)
159
 
        self.assertIn('launchpad-main-slave', self.zstorm_stores)
 
158
        self.assertIn('main-master', self.zstorm_stores)
 
159
        self.assertIn('main-slave', self.zstorm_stores)
160
160
 
161
161
        # With the store's connection being the same as before.
162
162
        master = getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR)
171
171
 
172
172
    def test_changing_modes(self):
173
173
        # Make sure the master/slave stores are present in zstorm.
174
 
        self.assertIn('launchpad-main-master', self.zstorm_stores)
175
 
        self.assertIn('launchpad-main-slave', self.zstorm_stores)
 
174
        self.assertIn('main-master', self.zstorm_stores)
 
175
        self.assertIn('main-slave', self.zstorm_stores)
176
176
 
177
177
        try:
178
178
            touch_read_only_file()
185
185
 
186
186
        # Here the mode has changed to read-only, so the stores were removed
187
187
        # from zstorm.
188
 
        self.assertNotIn('launchpad-main-master', self.zstorm_stores)
189
 
        self.assertNotIn('launchpad-main-slave', self.zstorm_stores)
 
188
        self.assertNotIn('main-master', self.zstorm_stores)
 
189
        self.assertNotIn('main-slave', self.zstorm_stores)
190
190
 
191
191
        # If they're needed again, they'll be re-created by ZStorm, and when
192
192
        # that happens they will point to the read-only databases.