Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove deprecated mock dependency #189

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/rest_api_model.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"swagger": "2.0", "basePath": "http://tng-package.5gtango.eu/api", "paths": {"/v1/packages": {"post": {"responses": {"400": {"description": "Bad package: Could not unpackage given package."}, "200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "operationId": "post_packages", "parameters": [{"name": "package", "in": "formData", "type": "file", "required": true, "description": "Uploaded package file"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "layer", "in": "formData", "type": "string", "description": "Layer tag to be unpackaged (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (optional)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "output", "in": "formData", "type": "string", "description": "Output (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}}, "/v1/packages/status": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusListGetReturn"}}}, "operationId": "get_packages_status_list", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/packages/status/{package_process_uuid}": {"parameters": [{"name": "package_process_uuid", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"404": {"description": "Package process not found."}, "200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "operationId": "get_packages_status_item", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/pings": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/PingGetReturn"}}}, "operationId": "get_ping", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/projects": {"get": {"responses": {"200": {"description": "Success"}}, "summary": "Get a list created packages", "description": "Returns: List of dictionaries: [{'package_name: <name>,\n 'package_download_link': <link>}, ..]", "operationId": "get_projects", "tags": ["v1"]}, "post": {"responses": {"400": {"description": "Bad project: Could not package given project."}, "200": {"description": "Successfully started packaging."}}, "operationId": "post_projects", "parameters": [{"name": "project", "in": "formData", "type": "file", "required": true, "description": "Uploaded project archive"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (ignored)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "output", "in": "formData", "type": "string", "description": "Output"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "no_subfolder_compression", "in": "formData", "type": "boolean", "description": "Ignore type:\n application/vnd.folder.compressed.zip"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}}, "/v1/projects/{filename}": {"parameters": [{"name": "filename", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"200": {"description": "Success"}}, "operationId": "get_project_download", "parameters": [{"name": "project", "in": "formData", "type": "file", "required": true, "description": "Uploaded project archive"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (ignored)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "output", "in": "formData", "type": "string", "description": "Output"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "no_subfolder_compression", "in": "formData", "type": "boolean", "description": "Ignore type:\n application/vnd.folder.compressed.zip"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}}}, "info": {"title": "5GTANGO tng-package API", "version": "0.1", "description": "5GTANGO tng-package REST API to package/unpacke NFV packages."}, "produces": ["application/json"], "consumes": ["application/json"], "tags": [{"name": "v1", "description": "tng-package API v1"}], "definitions": {"PackagesStatusItemGetReturn": {"required": ["package_process_uuid", "status"], "properties": {"package_process_uuid": {"type": "string", "description": "UUID of started unpackaging process."}, "status": {"type": "string", "description": "Status of the unpacking process: waiting|runnig|failed|done"}, "error_msg": {"type": "string", "description": "More detailed error message."}}, "type": "object"}, "PackagesStatusListGetReturn": {"properties": {"package_processes": {"type": "array", "items": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "type": "object"}, "PingGetReturn": {"required": ["alive_since"], "properties": {"alive_since": {"type": "string", "description": "system uptime"}}, "type": "object"}}, "responses": {"ParseError": {"description": "When a mask can't be parsed"}, "MaskError": {"description": "When any error occurs on mask"}}, "host": "tng-package.5gtango.eu"}
{"swagger": "2.0", "basePath": "/api", "paths": {"/v1/packages": {"post": {"responses": {"400": {"description": "Bad package: Could not unpackage given package."}, "200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "operationId": "post_packages", "parameters": [{"name": "package", "in": "formData", "type": "file", "required": true, "description": "Uploaded package file"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "layer", "in": "formData", "type": "string", "description": "Layer tag to be unpackaged (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (optional)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "output", "in": "formData", "type": "string", "description": "Output (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}}, "/v1/packages/status": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusListGetReturn"}}}, "operationId": "get_packages_status_list", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/packages/status/{package_process_uuid}": {"parameters": [{"name": "package_process_uuid", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"404": {"description": "Package process not found."}, "200": {"description": "Success", "schema": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "operationId": "get_packages_status_item", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/pings": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/PingGetReturn"}}}, "operationId": "get_ping", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["v1"]}}, "/v1/projects": {"post": {"responses": {"400": {"description": "Bad project: Could not package given project."}, "200": {"description": "Successfully started packaging."}}, "operationId": "post_projects", "parameters": [{"name": "project", "in": "formData", "type": "file", "required": true, "description": "Uploaded project archive"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (ignored)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "output", "in": "formData", "type": "string", "description": "Output"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "no_subfolder_compression", "in": "formData", "type": "boolean", "description": "Ignore type:\n application/vnd.folder.compressed.zip"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}, "get": {"responses": {"200": {"description": "Success"}}, "summary": "Get a list created packages", "description": "Returns: List of dictionaries: [{'package_name: <name>,\n 'package_download_link': <link>}, ..]", "operationId": "get_projects", "tags": ["v1"]}}, "/v1/projects/{filename}": {"parameters": [{"name": "filename", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"200": {"description": "Success"}}, "operationId": "get_project_download", "parameters": [{"name": "project", "in": "formData", "type": "file", "required": true, "description": "Uploaded project archive"}, {"name": "callback_url", "in": "formData", "type": "string", "description": "URL called after unpackaging (optional)"}, {"name": "username", "in": "formData", "type": "string", "description": "Username of the uploader (optional)"}, {"name": "format", "in": "formData", "type": "string", "description": "Package format (optional)"}, {"name": "skip_store", "in": "formData", "type": "boolean", "description": "Skip catalog upload\n of contents (ignored)"}, {"name": "skip_validation", "in": "formData", "type": "boolean", "description": "Skip service validation (optional)"}, {"name": "validation_level", "in": "formData", "type": "string", "description": "Set validation level.\n Possible values:\n 's' or 'syntax',\n 'i' or 'integrity',\n 't' or 'topology' ,\n 'skip'", "enum": ["s", "syntax", "i", "integrity", "t", "topology", "skip"], "collectionFormat": "multi"}, {"name": "output", "in": "formData", "type": "string", "description": "Output"}, {"name": "workspace", "in": "formData", "type": "string", "description": "Workspace (ignored for now)"}, {"name": "offline", "in": "formData", "type": "string", "description": "Offline"}, {"name": "no_checksums", "in": "formData", "type": "string", "description": "Do not validate artifact checksums."}, {"name": "no_subfolder_compression", "in": "formData", "type": "boolean", "description": "Ignore type:\n application/vnd.folder.compressed.zip"}], "consumes": ["multipart/form-data"], "tags": ["v1"]}}}, "info": {"title": "5GTANGO tng-package API", "version": "0.1", "description": "5GTANGO tng-package REST API to package/unpacke NFV packages."}, "produces": ["application/json"], "consumes": ["application/json"], "tags": [{"name": "v1", "description": "tng-package API v1"}], "definitions": {"PackagesStatusItemGetReturn": {"required": ["package_process_uuid", "status"], "properties": {"package_process_uuid": {"type": "string", "description": "UUID of started unpackaging process."}, "status": {"type": "string", "description": "Status of the unpacking process: waiting|runnig|failed|done"}, "error_msg": {"type": "string", "description": "More detailed error message."}}, "type": "object"}, "PackagesStatusListGetReturn": {"properties": {"package_processes": {"type": "array", "items": {"$ref": "#/definitions/PackagesStatusItemGetReturn"}}}, "type": "object"}, "PingGetReturn": {"required": ["alive_since"], "properties": {"alive_since": {"type": "string", "description": "system uptime"}}, "type": "object"}}, "responses": {"ParseError": {"description": "When a mask can't be parsed"}, "MaskError": {"description": "When any error occurs on mask"}}, "host": "tng-package.5gtango.eu"}
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ jsonschema
coloredlogs
requests
flask-restplus
mock
pyrfc3339
pyrfc3339
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

setup(name='tngsdk.package',
license='Apache License, Version 2.0',
version='5.0.3',
version='5.0.4',
url='https://github.com/sonata-nfv/tng-sdk-package',
author='Manuel Peuster',
author_email='manuel.peuster@uni-paderborn.de',
Expand Down
2 changes: 1 addition & 1 deletion src/tngsdk/package/tests/test_unit_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import time
import tempfile
import os
from mock import patch
from unittest.mock import patch
from requests.exceptions import RequestException
from tngsdk.package.rest import app, on_unpackaging_done, on_packaging_done
from tngsdk.package.packager import PM
Expand Down
2 changes: 1 addition & 1 deletion src/tngsdk/package/tests/test_unit_storage_tngcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


import unittest
from mock import patch
from unittest.mock import patch
from requests.exceptions import RequestException
from requests import get as real_get
from tngsdk.package.cli import parse_args
Expand Down