def setUpClass(cls): """ These run once per Test suite """ app.config['TESTING'] = True app.config['DEBUG'] = False app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.logger.setLevel(logging.CRITICAL) Pet.init_db(app)
def setUpClass(cls): """This runs once before the entire test suite""" app.config["TESTING"] = True app.config["DEBUG"] = False app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.logger.setLevel(logging.CRITICAL) Pet.init_db(app)
def test_vcap_services(self): """ Test if VCAP_SERVICES works """ Pet.init_db() self.assertIsNotNone(Pet.client) Pet("fido", "dog", True).save() pets = Pet.find_by_name("fido") self.assertNotEqual(len(pets), 0) self.assertEqual(pets[0].name, "fido")
def setUp(self): """ Initialize the Cloudant database """ self.app = app.test_client() Pet.init_db("tests") Pet.remove_all() Pet("fido", "dog", True).save() Pet("kitty", "cat", True).save() Pet("harry", "hippo", False).save()
def setUp(self): """ Initialize the Cloudant database """ self.app = app.test_client() Pet.init_db("tests") # Cloudant Lite will rate limit so you must sleep between requests :() sleep(0.5) Pet.remove_all() sleep(0.5) Pet("fido", "dog", True).save() sleep(0.5) Pet("kitty", "cat", True).save() sleep(0.5) Pet("harry", "hippo", False).save() sleep(0.5)
def setUp(self): Pet.init_db(app) db.drop_all() # clean up the last tests db.create_all() # make our sqlalchemy tables
def init_db(dbname="pets"): """ Initlaize the model """ Pet.init_db(dbname)
def setUpClass(cls): """ These run once before Test suite """ app.debug = False # Set up the test database app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI Pet.init_db(app)
def init_db(redis=None): """ Initlaize the model """ Pet.init_db(redis)
def test_vcap_with_binding(self): """ Test no VCAP_SERVICES with BINDING_CLOUDANT """ Pet.init_db("test") self.assertIsNotNone(Pet.client) self.assertIsNotNone(Pet.database)
def setUp(self): """ Initialize the Redis database """ Pet.init_db() Pet.remove_all()
def test_vcap_services(self): """ Test if VCAP_SERVICES works """ Pet.init_db() self.assertIsNotNone(Pet.redis)
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)
def init_db(): """ Initialies the SQLAlchemy app """ global app Pet.init_db(app)
def setUp(self): self.app = app.test_client() Pet.init_db("tests") Pet.remove_all()
def test_vcap_no_services(self): """ Test BINDING_CLOUDANT """ Pet.init_db("test") self.assertIsNotNone(Pet.client) self.assertIsNotNone(Pet.database)
def setUp(self): """ Initialize the Cloudant database """ Pet.init_db("test") Pet.remove_all()
def test_vcap_no_services(self): """ Test VCAP_SERVICES without Cloudant """ Pet.init_db("test") self.assertIsNotNone(Pet.client) self.assertIsNotNone(Pet.database)