1 # Copyright 2018 ZTE Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 from lcm.pub.verifyvnfd import verifyvnfd
18 from lcm.pub.exceptions import NFLCMException
21 class VerifyVnfdTest(unittest.TestCase):
28 def test_vnfd_verfify_success1(self):
29 ret = verifyvnfd.verify(const.vnfd_model1)
30 self.assertEqual(ret, True)
32 def test_vnfd_verfify_success2(self):
33 ret = verifyvnfd.verify(const.vnfd_model2)
34 self.assertEqual(ret, True)
36 def test_vnfd_verfify_success3(self):
37 ret = verifyvnfd.verify(const.vnfd_model3)
38 self.assertEqual(ret, True)
40 def test_vnfd_verfify_fail_for_missing_required(self):
42 verifyvnfd.verify(const.vnfd_model_miss_required)
43 except NFLCMException as e:
44 self.assertNotEqual(e.args[0], "")