diff options
-rw-r--r-- | catalog/packages/tests/test_pnf_descriptor.py | 6 | ||||
-rw-r--r-- | catalog/packages/tests/test_vnf_package.py | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/catalog/packages/tests/test_pnf_descriptor.py b/catalog/packages/tests/test_pnf_descriptor.py index a722d805..97515187 100644 --- a/catalog/packages/tests/test_pnf_descriptor.py +++ b/catalog/packages/tests/test_pnf_descriptor.py @@ -17,6 +17,7 @@ import copy import json import mock import os +import shutil from django.test import TestCase @@ -25,6 +26,7 @@ from rest_framework.test import APIClient from catalog.packages.biz.pnf_descriptor import PnfDescriptor from catalog.packages.const import PKG_STATUS from catalog.packages.tests.const import pnfd_data +from catalog.pub.config.config import CATALOG_ROOT_PATH from catalog.pub.database.models import PnfPackageModel, NSPackageModel from catalog.pub.utils import toscaparser @@ -55,7 +57,9 @@ class TestPnfDescriptor(TestCase): } def tearDown(self): - pass + file_path = os.path.join(CATALOG_ROOT_PATH, "22") + if os.path.exists(file_path): + shutil.rmtree(file_path) def test_pnfd_create_normal(self): request_data = {'userDefinedData': self.user_defined_data} diff --git a/catalog/packages/tests/test_vnf_package.py b/catalog/packages/tests/test_vnf_package.py index 9f0cef51..07486cdc 100644 --- a/catalog/packages/tests/test_vnf_package.py +++ b/catalog/packages/tests/test_vnf_package.py @@ -16,6 +16,7 @@ import json import os import urllib2 import mock +import shutil from django.test import TestCase from rest_framework import status @@ -42,7 +43,9 @@ class TestVnfPackage(TestCase): self.client = APIClient() def tearDown(self): - pass + file_path = os.path.join(CATALOG_ROOT_PATH, "222") + if os.path.exists(file_path): + shutil.rmtree(file_path) @mock.patch.object(toscaparser, 'parse_vnfd') def test_upload_vnf_pkg(self, mock_parse_vnfd): |