Merge "ansible: disable Extra cloud image kernel stub"
[yardstick.git] / yardstick / tests / unit / apiserver / resources / v1 / test_testsuites.py
1 ##############################################################################
2 # Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
3 #
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 ##############################################################################
9 import mock
10
11 import unittest
12
13 from yardstick.tests.unit.apiserver import APITestCase
14 from api.utils.thread import TaskThread
15
16
17 class TestsuiteTestCase(APITestCase):
18
19     def test_run_test_suite(self):
20         if self.app is None:
21             unittest.skip('host config error')
22             return
23
24         TaskThread.start = mock.MagicMock()
25
26         url = 'yardstick/testsuites/action'
27         data = {
28             'action': 'run_test_suite',
29             'args': {
30                 'opts': {},
31                 'testsuite': 'opnfv_smoke'
32             }
33         }
34         resp = self._post(url, data)
35         self.assertEqual(resp.get('status'), 1)