Loading src/tests/tools/mock_osm_nbi/ResourceOsmClient.py +6 −14 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading Loading
src/tests/tools/mock_osm_nbi/ResourceOsmClient.py +6 −14 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading