diff options
author | 2018-04-27 10:37:37 +0000 | |
---|---|---|
committer | 2018-06-22 16:03:45 +0000 | |
commit | 84f634020d1a67f373127b831adc4ed0f6c438df (patch) | |
tree | 69c9d8854686a2bef637e9b932eaff07424133bd /tests/unit/network_services/traffic_profile/test_base.py | |
parent | 5d3a4a8c10fdde34e16381cb8f16450837d33af3 (diff) |
Move tests: unit/network_services/traffic_profile
* Fix pylint errors
* Add TODOs
Some errors are ignored locally, as they were a symptom of other problems.
These issues have been flagged with a TODO, and should be fixed later.
JIRA: YARDSTICK-837
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Change-Id: Id983a2e415d66633331e7fea96a377e2a7589980
(cherry-picked from commit cfc40ad1bb36889e54bc99cb779cfcfa1f3b04dd)
Diffstat (limited to 'tests/unit/network_services/traffic_profile/test_base.py')
-rw-r--r-- | tests/unit/network_services/traffic_profile/test_base.py | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/tests/unit/network_services/traffic_profile/test_base.py b/tests/unit/network_services/traffic_profile/test_base.py deleted file mode 100644 index 3b8804976..000000000 --- a/tests/unit/network_services/traffic_profile/test_base.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (c) 2016-2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys - -import mock -import unittest - -from yardstick.common import exceptions -from yardstick.network_services import traffic_profile as tprofile_package -from yardstick.network_services.traffic_profile import base -from yardstick import tests as y_tests - - -class TestTrafficProfile(unittest.TestCase): - TRAFFIC_PROFILE = { - "schema": "isb:traffic_profile:0.1", - "name": "fixed", - "description": "Fixed traffic profile to run UDP traffic", - "traffic_profile": { - "traffic_type": "FixedTraffic", - "frame_rate": 100, # pps - "flow_number": 10, - "frame_size": 64}} - - def _get_res_mock(self, **kw): - _mock = mock.MagicMock() - for k, v in kw.items(): - setattr(_mock, k, v) - return _mock - - def test___init__(self): - traffic_profile = base.TrafficProfile(self.TRAFFIC_PROFILE) - self.assertEqual(self.TRAFFIC_PROFILE, traffic_profile.params) - - def test_execute(self): - traffic_profile = base.TrafficProfile(self.TRAFFIC_PROFILE) - self.assertRaises(NotImplementedError, - traffic_profile.execute_traffic, {}) - - def test_get_existing_traffic_profile(self): - traffic_profile_list = [ - 'RFC2544Profile', 'FixedProfile', 'TrafficProfileGenericHTTP', - 'IXIARFC2544Profile', 'ProxACLProfile', 'ProxBinSearchProfile', - 'ProxProfile', 'ProxRampProfile'] - with mock.patch.dict(sys.modules, y_tests.STL_MOCKS): - tprofile_package.register_modules() - - for tp in traffic_profile_list: - traffic_profile = base.TrafficProfile.get( - {'traffic_profile': {'traffic_type': tp}}) - self.assertEqual(tp, traffic_profile.__class__.__name__) - - def test_get_non_existing_traffic_profile(self): - self.assertRaises(exceptions.TrafficProfileNotImplemented, - base.TrafficProfile.get, self.TRAFFIC_PROFILE) - - -class TestDummyProfile(unittest.TestCase): - def test_execute(self): - dummy_profile = base.DummyProfile(base.TrafficProfile) - self.assertIsNone(dummy_profile.execute({})) |