def test_flush(self): """Test flushing the instance""" instance = MongoInstance(10101) collection = instance.conn['someDb']['someCollection'] collection.insert({'foo': 'bar'}) self.assertEqual(collection.find({'foo': 'bar'}).next()['foo'], 'bar') instance.flush() self.assertEqual(collection.find({'foo': 'bar'}).count(), 0) instance.terminate()
def test_flush(self): """Test flushing the instance""" instance = MongoInstance(10101) collection = instance.conn['someDb']['someCollection'] collection.insert({'foo': 'bar'}) self.assertEqual( collection.find({'foo': 'bar'}).next()['foo'], 'bar' ) instance.flush() self.assertEqual(collection.find({'foo': 'bar'}).count(), 0) instance.terminate()
def test_gevent(self): """Test starting mongo with gevent.""" instance = MongoInstance(10101, use_gevent=True) self.assertEqual(len(managed_instance.running_instances), 1) instance.flush() instance.terminate()