summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael S. Pedersen <michael.soelvkaer@gmail.com>2019-12-03 11:38:32 +0000
committerMichael S. Pedersen <michael.soelvkaer@gmail.com>2019-12-09 22:07:08 +0000
commit95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce (patch)
tree8d2d8cd00f3284036e9bf78d9ec9bfdb3e95c80b /test
parent24314713446b6411cedce4329ab5ebfd6da678a2 (diff)
NFVBENCH-153 Add support for python34.0.0
JIRA: NFVBENCH-153 Done using 2to3-3.6 with additional changes to fix data parsing and testing (tox) Signed-off-by: Michael S. Pedersen <michael.soelvkaer@gmail.com> Change-Id: I242902f800da543d780507828c9bd1fbf409da6d
Diffstat (limited to 'test')
-rw-r--r--test/mock_trex.py3
-rw-r--r--test/test_chains.py9
-rw-r--r--test/test_nfvbench.py3
3 files changed, 5 insertions, 10 deletions
diff --git a/test/mock_trex.py b/test/mock_trex.py
index ed6b20e..4f0271a 100644
--- a/test/mock_trex.py
+++ b/test/mock_trex.py
@@ -30,8 +30,6 @@ except ImportError:
class STLDummy(Exception):
"""Dummy class."""
- pass
-
trex_lib_mod = ModuleType('trex')
sys.modules['trex'] = trex_lib_mod
stl_lib_mod = ModuleType('trex.stl')
@@ -77,4 +75,3 @@ except ImportError:
def no_op():
"""Empty function."""
- pass
diff --git a/test/test_chains.py b/test/test_chains.py
index 741bee7..3cf75cb 100644
--- a/test/test_chains.py
+++ b/test/test_chains.py
@@ -15,12 +15,12 @@
#
"""Test Chaining functions."""
-from mock_trex import no_op
-
from mock import MagicMock
from mock import patch
import pytest
+from .mock_trex import no_op
+
from nfvbench.chain_runner import ChainRunner
from nfvbench.chaining import ChainException
from nfvbench.chaining import ChainVnfPort
@@ -40,7 +40,6 @@ from nfvbench.traffic_client import TrafficClient
from nfvbench.traffic_gen.traffic_base import Latency
from nfvbench.traffic_gen.trex_gen import TRex
-
# just to get rid of the unused function warning
no_op()
@@ -157,7 +156,7 @@ def _test_pvp_chain_no_admin_no_config_values(config, cred, mock_glance, mock_ne
runner.close()
def test_pvp_chain_runner_no_admin_no_config_values():
- """Test PVP chain runner."""
+ """Test PVP/mock chain runner."""
cred = MagicMock(spec=nfvbench.credentials.Credentials)
cred.is_admin = False
for shared_net in [True, False]:
@@ -260,7 +259,7 @@ def _check_nfvbench_openstack(sc=ChainType.PVP, l2_loopback=False):
nfvb = NFVBench(config, openstack_spec, config_plugin, factory)
res = nfvb.run({}, 'pytest')
if res['status'] != 'OK':
- print res
+ print(res)
assert res['status'] == 'OK'
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index 7a0a9ed..4a8a574 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
#
-from mock_trex import no_op
-
import json
import logging
import sys
@@ -34,6 +32,7 @@ from nfvbench.traffic_client import IpBlock
from nfvbench.traffic_client import TrafficClient
import nfvbench.traffic_gen.traffic_utils as traffic_utils
+from .mock_trex import no_op
# just to get rid of the unused function warning
no_op()