Ejemplo n.º 1
0
 def update_client(id):
     client = Client.deserialize(request.json)
     client.id = id
     update_count = ClientService.update_client(client)
     if update_count > 0:
         return f"Successfully updated {update_count} item", 200
     else:
         logger.log(f"Client could not be updated with an id of {id}\n{request.json}")
         return "Client Not Found", 404
Ejemplo n.º 2
0
 def test_02_get_all(self):
     clients = ClientService.get_all_clients()
     ClientServiceTest.client = Client.deserialize(clients.pop())
     self.assertTrue(clients)
Ejemplo n.º 3
0
 def create_client():
     ClientService.create_client(Client.deserialize(request.json))
     logger.log(request.json, logging.INFO)
     return "Success!", 201