def setUp(self): server.app.debug = True server.app.logger.addHandler(logging.StreamHandler()) server.app.logger.setLevel(logging.CRITICAL) self.app = server.app.test_client() server.inititalize_redis() server.data_reset() server.data_load({"name": "fido", "category": "dog"}) server.data_load({"name": "kitty", "category": "cat"})
def setUp(self): server.app.debug = True server.app.logger.addHandler(logging.StreamHandler()) server.app.logger.setLevel(logging.CRITICAL) self.app = server.app.test_client() server.inititalize_redis() server.data_reset() server.data_load({"customer_name": "Tom", "amount_paid": "200"}) server.data_load({"customer_name": "Bob", "amount_paid": "300"})
def setUp(self): server.inititalize_redis() Order.use_db(server.redis) #Order.use_db(Redis(host='127.0.0.1', port=6379)) Order.remove_all()
def before_all(context): context.app = server.app.test_client() server.inititalize_redis() context.server = server
import os from app import app, server # Pull options from environment debug = (os.getenv('DEBUG', 'False') == 'True') port = os.getenv('PORT', '5000') ###################################################################### # M A I N ###################################################################### if __name__ == "__main__": print "Pet Service Starting..." server.inititalize_redis() app.run(host='0.0.0.0', port=int(port), debug=debug)