Commit 21b4a158 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - Mock OSM NBI:

- Fixed VIM Account resources
parent 7db736eb
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -134,19 +134,11 @@ class VimAccountItem(Resource):
      • DELETE → Delete VIM Account
    """

    @staticmethod
    def _find(account_id):
        """Search VIM account"""
        return next(
            (acc for acc in OSM_VIM if acc["_id"] == account_id),
            None
        )

    # ------------------------
    # GET /vim_accounts/<id>
    # ------------------------
    def get(self, account_id):
        vim_account = self._find(account_id)
    def get(self, account_id : str):
        vim_account = OSM_VIM.get(account_id)
        if not vim_account:
            error = {'error': 'not found'}
            return make_response(jsonify(error), 404)
@@ -155,8 +147,8 @@ class VimAccountItem(Resource):
    # ------------------------
    # PUT /vim_accounts/<id>
    # ------------------------
    def put(self, account_id):
        vim_account = self._find(account_id)
    def put(self, account_id : str):
        vim_account = OSM_VIM.get(account_id)
        if not vim_account:
            error = {'error': 'not found'}
            return make_response(jsonify(error), 404)
@@ -171,8 +163,8 @@ class VimAccountItem(Resource):
    # ------------------------
    # DELETE /vim_accounts/<id>
    # ------------------------
    def delete(self, account_id):
        vim_account = self._find(account_id)
    def delete(self, account_id : str):
        vim_account = OSM_VIM.get(account_id)
        if not vim_account:
            error = {'error': 'not found'}
            return make_response(jsonify(error), 404)