Esempio n. 1
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"})
Esempio n. 2
0
 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
     })
Esempio n. 3
0
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
Esempio n. 4
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
        })
Esempio n. 5
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
        })
 def setUp(self):
     server.app.debug = True
     self.app = server.app.test_client()
     server.init_redis(True)
     server.data_reset()
Esempio n. 7
0
 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)
Esempio n. 8
0
 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()