Exemplo n.º 1
0
 def test_engine(self):
     for id in ids:
         content_type = 'application/json'
         actions = ['START', 'STOP']
         for action in actions:
             response = sc.get_engine(id, content_type, action)
             self.assertNotEqual(response,
                                 'Status code other than 200 received!')
Exemplo n.º 2
0
 def post(self, request, id):
     content_type = request.content_type
     action = request.data['action']
     info = sc.get_engine(id, content_type, action)
     if info == 'Status code other than 200 received!':
         response = Response()
         response.status_code = 404
         return response
     engine = Engine()
     engine.status = info['status']
     serializer = EngineSerializer(engine)
     return Response(serializer.data)