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): self.app = server.app.test_client() server.initialize_logging(logging.CRITICAL) server.init_db() server.data_reset() server.data_load({ "name": "fido", "category": "dog", "available": True }) server.data_load({ "name": "kitty", "category": "cat", "available": True })
def step_impl(context): server.data_reset() users = {} url = '/users' i = str(1) for row in context.table: user = {'name': row['name'], 'times': []} context.resp = context.app.post(url, data=json.dumps(user), content_type='application/json') users[i] = user #context.resp = context.app.post(url, data=json.dumps()) i = str(int(i) + 1) # context.resp = context.app.post(url, data=json.dumps(users), content_type='application/json') context.server.users = users
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({ "first_name": "Andrea", "last_name": "Pirlo", "gender": "M", "age": "35", "email": "*****@*****.**", "address_line1": "Milan", "address_line2": "Italy", "phonenumber": "123", "active": True }) server.data_load({ "first_name": "Theirry", "last_name": "Henry", "gender": "M", "age": "30", "email": "*****@*****.**", "address_line1": "London", "address_line2": "England", "phonenumber": "444", "active": True }) server.data_load({ "first_name": "Ronaldinho", "last_name": "Gaucho", "gender": "M", "age": "40", "email": "*****@*****.**", "address_line1": "Barcelona", "address_line2": "Spain", "phonenumber": "999", "active": True })
def setUp(self): server.app.debug = True # Silence the logs unless it's critical 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", "available": True }) server.data_load({ "name": "kitty", "category": "cat", "available": True })
def setUp(self): server.app.debug = True self.app = server.app.test_client() server.init_redis(True) server.data_reset()
def test_no_data_in_database(self): """Database is empty : get the list""" server.data_reset() resp = self.app.get('/wishlists') self.assertEqual(resp.status_code, status.HTTP_404_NOT_FOUND)
def setUp(self): self.app = server.app.test_client() server.init_db() server.data_reset() server.Customer(1, 'happy', [1, 2]).save() server.Customer(1, 'sad', [3]).save()