1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3# Copyright (c) 2021 Huawei Device Co., Ltd. 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16import unittest 17 18from utils import SCRIPT_KEY_LIST 19from utils import clear_resource 20from vendor_script import create_vendor_script_class 21from vendor_script import VendorPreludeScript 22from vendor_script import VendorVerseScript 23from vendor_script import VendorRefrainScript 24from vendor_script import VendorEndingScript 25from vendor_script import ExtensionCmdRegister 26 27 28class TestVendorScript(unittest.TestCase): 29 30 def setUp(self): 31 print("set up") 32 33 def tearDown(self): 34 print("tear down") 35 36 def test_vendor_script(self): 37 opera_obj_list = create_vendor_script_class() 38 TestVendorPreludeScript() 39 test_vendor_verse_script = TestVendorVerseScript() 40 test_vendor_verse_script.set_status("1") 41 test_vendor_verse_script.get_status() 42 test_vendor_verse_script.reboot_now() 43 TestVendorRefrainScript() 44 TestVendorEndingScript() 45 46 ExtensionCmdRegister().generate_register_cmd_script() 47 self.assertEqual(opera_obj_list, [None] * len(SCRIPT_KEY_LIST)) 48 clear_resource() 49 50 51class TestVendorPreludeScript(VendorPreludeScript): 52 def __init__(self): 53 super().__init__() 54 55 56class TestVendorVerseScript(VendorVerseScript): 57 def __init__(self): 58 super().__init__() 59 60 61class TestVendorRefrainScript(VendorRefrainScript): 62 def __init__(self): 63 super().__init__() 64 65 66class TestVendorEndingScript(VendorEndingScript): 67 def __init__(self): 68 super().__init__() 69