コード例 #1
0
 def setUp(self):
     server.app.debug = True
     self.app = server.app.test_client()
     server.inititalize_redis()
     new_account = {'name': 'Gina', 'balance': 1000, 'active': 0}
     data = json.dumps(new_account)
     resp = self.app.post('/accounts',
                          data=data,
                          content_type='application/json')
     self.idRef = json.loads(resp.data)['id']
コード例 #2
0
    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"})
コード例 #3
0
    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
        })
コード例 #4
0
    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
        })
コード例 #5
0
def before_all(context):
    context.app = server.app.test_client()
    server.inititalize_redis()
    context.server = server
コード例 #6
0
 def setUp(self):
     server.inititalize_redis()
     Pet.use_db(server.redis)
     # Pet.use_db(Redis(host='127.0.0.1', port=6379))
     Pet.remove_all()
コード例 #7
0
 def test_without_nextId(self):
     server.redis_server.flushdb()
     self.assertTrue(server.get_next_id() == None)
     server.inititalize_redis()
     self.assertTrue(server.get_next_id() == "1")
コード例 #8
0
def step_impl(context):
    context.app = server.app.test_client()
    context.server = server
    server.inititalize_redis()