140681896Sopenharmony_ci#!/usr/bin/env python 240681896Sopenharmony_ci# -*- coding: utf-8 -*- 340681896Sopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd. 440681896Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 540681896Sopenharmony_ci# you may not use this file except in compliance with the License. 640681896Sopenharmony_ci# You may obtain a copy of the License at 740681896Sopenharmony_ci# 840681896Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 940681896Sopenharmony_ci# 1040681896Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 1140681896Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1240681896Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1340681896Sopenharmony_ci# See the License for the specific language governing permissions and 1440681896Sopenharmony_ci# limitations under the License. 1540681896Sopenharmony_ci 1640681896Sopenharmony_ciimport unittest 1740681896Sopenharmony_ci 1840681896Sopenharmony_cifrom utils import SCRIPT_KEY_LIST 1940681896Sopenharmony_cifrom utils import clear_resource 2040681896Sopenharmony_cifrom vendor_script import create_vendor_script_class 2140681896Sopenharmony_cifrom vendor_script import VendorPreludeScript 2240681896Sopenharmony_cifrom vendor_script import VendorVerseScript 2340681896Sopenharmony_cifrom vendor_script import VendorRefrainScript 2440681896Sopenharmony_cifrom vendor_script import VendorEndingScript 2540681896Sopenharmony_cifrom vendor_script import ExtensionCmdRegister 2640681896Sopenharmony_ci 2740681896Sopenharmony_ci 2840681896Sopenharmony_ciclass TestVendorScript(unittest.TestCase): 2940681896Sopenharmony_ci 3040681896Sopenharmony_ci def setUp(self): 3140681896Sopenharmony_ci print("set up") 3240681896Sopenharmony_ci 3340681896Sopenharmony_ci def tearDown(self): 3440681896Sopenharmony_ci print("tear down") 3540681896Sopenharmony_ci 3640681896Sopenharmony_ci def test_vendor_script(self): 3740681896Sopenharmony_ci opera_obj_list = create_vendor_script_class() 3840681896Sopenharmony_ci TestVendorPreludeScript() 3940681896Sopenharmony_ci test_vendor_verse_script = TestVendorVerseScript() 4040681896Sopenharmony_ci test_vendor_verse_script.set_status("1") 4140681896Sopenharmony_ci test_vendor_verse_script.get_status() 4240681896Sopenharmony_ci test_vendor_verse_script.reboot_now() 4340681896Sopenharmony_ci TestVendorRefrainScript() 4440681896Sopenharmony_ci TestVendorEndingScript() 4540681896Sopenharmony_ci 4640681896Sopenharmony_ci ExtensionCmdRegister().generate_register_cmd_script() 4740681896Sopenharmony_ci self.assertEqual(opera_obj_list, [None] * len(SCRIPT_KEY_LIST)) 4840681896Sopenharmony_ci clear_resource() 4940681896Sopenharmony_ci 5040681896Sopenharmony_ci 5140681896Sopenharmony_ciclass TestVendorPreludeScript(VendorPreludeScript): 5240681896Sopenharmony_ci def __init__(self): 5340681896Sopenharmony_ci super().__init__() 5440681896Sopenharmony_ci 5540681896Sopenharmony_ci 5640681896Sopenharmony_ciclass TestVendorVerseScript(VendorVerseScript): 5740681896Sopenharmony_ci def __init__(self): 5840681896Sopenharmony_ci super().__init__() 5940681896Sopenharmony_ci 6040681896Sopenharmony_ci 6140681896Sopenharmony_ciclass TestVendorRefrainScript(VendorRefrainScript): 6240681896Sopenharmony_ci def __init__(self): 6340681896Sopenharmony_ci super().__init__() 6440681896Sopenharmony_ci 6540681896Sopenharmony_ci 6640681896Sopenharmony_ciclass TestVendorEndingScript(VendorEndingScript): 6740681896Sopenharmony_ci def __init__(self): 6840681896Sopenharmony_ci super().__init__() 69