aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/apiserver/resources/v1/test_testsuites.py
blob: 85c045f44df62d6e84e3dd586223c0229af740c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
##############################################################################
# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import mock

import unittest

from yardstick.tests.unit.apiserver import APITestCase
from api.utils.thread import TaskThread


class TestsuiteTestCase(APITestCase):

    def test_run_test_suite(self):
        if self.app is None:
            unittest.skip('host config error')
            return

        TaskThread.start = mock.MagicMock()

        url = 'yardstick/testsuites/action'
        data = {
            'action': 'run_test_suite',
            'args': {
                'opts': {},
                'testsuite': 'opnfv_smoke'
            }
        }
        resp = self._post(url, data)
        self.assertEqual(resp.get('status'), 1)