181
181
self.assert_(self.is_db_available())
183
183
with PGBouncerFixture() as pgbouncer:
184
self.assert_(self.is_db_available())
184
self.assertTrue(self.is_db_available())
187
self.assert_(not self.is_db_available())
187
self.assertFalse(self.is_db_available())
189
189
# This confirms that we are again connecting directly to the
190
190
# database, as the pgbouncer process was shutdown.
191
self.assert_(self.is_db_available())
191
self.assertTrue(self.is_db_available())
193
193
def test_install_fixture_with_restart(self):
194
194
self.assert_(self.is_db_available())
196
196
with PGBouncerFixture() as pgbouncer:
197
self.assert_(self.is_db_available())
197
self.assertTrue(self.is_db_available())
200
self.assert_(not self.is_db_available())
200
self.assertFalse(self.is_db_available())
202
202
pgbouncer.start()
203
self.assert_(self.is_db_available())
203
self.assertTrue(self.is_db_available())
205
205
# Note that because pgbouncer was left running, we can't confirm
206
206
# that we are now connecting directly to the database.
207
self.assert_(self.is_db_available())
207
self.assertTrue(self.is_db_available())