Esempio n. 1
0
 def setUp(self):
     """ Initialize the Redis database """
     Pet.init_db()
     Pet.remove_all()
Esempio n. 2
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)
Esempio n. 3
0
 def test_vcap_services(self):
     """ Test if VCAP_SERVICES works """
     Pet.init_db()
     self.assertIsNotNone(Pet.redis)
Esempio n. 4
0
def init_db(redis=None):
    """ Initlaize the model """
    Pet.init_db(redis)
Esempio n. 5
0
 def setUp(self):
     Pet.init_db(app)
     db.drop_all()  # clean up the last tests
     db.create_all()  # make our sqlalchemy tables
Esempio n. 6
0
 def setUp(self):
     """ Initialize the Cloudant database """
     Pet.init_db("test")
     Pet.remove_all()
Esempio n. 7
0
def init_db(redis=None):
    """ Initlaize the model """
    try:
        Pet.init_db(redis)
    except DatabaseConnectionError as error:
        api.handle_error(error)
Esempio n. 8
0
def init_db(dbname="pets"):
    """ Initlaize the model """
    Pet.init_db(dbname)