1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 from api.utils.daemonthread import DaemonThread
15 class DaemonThreadTestCase(unittest.TestCase):
17 @mock.patch('api.utils.daemonthread.os')
18 def test_run(self, mock_os):
19 def func(common_list, task_id):
24 thread = DaemonThread(func, (common_list, task_id))
27 mock_os.path.exist.return_value = True
28 pre_path = '../tests/opnfv/test_suites/'
29 mock_os.remove.assert_called_with(pre_path + '1234.yaml')
36 if __name__ == '__main__':