Beispiel #1
0
def init_db(redis=None):
    """ Initlaize the model """
    Pet.init_db(redis)
Beispiel #2
0
 def setUp(self):
     """ Initialize the Redis database """
     Pet.init_db()
     Pet.remove_all()
Beispiel #3
0
 def test_vcap_services(self):
     """ Test if VCAP_SERVICES works """
     Pet.init_db()
     self.assertIsNotNone(Pet.redis)
Beispiel #4
0
 def test_passing_connection(self):
     """ Pass in the Redis connection """
     Pet.init_db(Redis(host='127.0.0.1', port=6379))
     self.assertIsNotNone(Pet.redis)
Beispiel #5
0
def init_db():
    """ Initialies the SQLAlchemy app """
    global app
    Pet.init_db(app)
 def setUp(self):
     Pet.init_db(app)
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables