Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Module to manage pip packages"
[yardstick.git]
/
tests
/
unit
/
network_services
/
traffic_profile
/
test_prox_profile.py
diff --git
a/tests/unit/network_services/traffic_profile/test_prox_profile.py
b/tests/unit/network_services/traffic_profile/test_prox_profile.py
index
14223da
..
078e72b
100644
(file)
--- a/
tests/unit/network_services/traffic_profile/test_prox_profile.py
+++ b/
tests/unit/network_services/traffic_profile/test_prox_profile.py
@@
-26,6
+26,7
@@
stl_patch.start()
if stl_patch:
from yardstick.network_services.traffic_profile.prox_profile import ProxProfile
if stl_patch:
from yardstick.network_services.traffic_profile.prox_profile import ProxProfile
+ from yardstick.network_services.vnf_generic.vnf.prox_helpers import ProxResourceHelper
class TestProxProfile(unittest.TestCase):
class TestProxProfile(unittest.TestCase):
@@
-62,10
+63,11
@@
class TestProxProfile(unittest.TestCase):
}
profile = ProxProfile(tp_config)
}
profile = ProxProfile(tp_config)
- profile.init(234)
- self.assertEqual(profile.queue, 234)
+ queue = mock.Mock()
+ profile.init(queue)
+ self.assertIs(profile.queue, queue)
- def test_execute(self):
+ def test_execute
_traffic
(self):
packet_sizes = [
10,
100,
packet_sizes = [
10,
100,
@@
-78,14
+80,22
@@
class TestProxProfile(unittest.TestCase):
}
traffic_generator = mock.MagicMock()
}
traffic_generator = mock.MagicMock()
+
+ setup_helper = traffic_generator.setup_helper
+ setup_helper.find_in_section.return_value = None
+
+ prox_resource_helper = ProxResourceHelper(setup_helper)
+ traffic_generator.resource_helper = prox_resource_helper
+
profile = ProxProfile(tp_config)
self.assertFalse(profile.done)
for _ in packet_sizes:
with self.assertRaises(NotImplementedError):
profile = ProxProfile(tp_config)
self.assertFalse(profile.done)
for _ in packet_sizes:
with self.assertRaises(NotImplementedError):
- profile.execute(traffic_generator)
+ profile.execute
_traffic
(traffic_generator)
- self.assertIsNone(profile.execute(traffic_generator))
+ self.assertIsNone(profile.execute_traffic(traffic_generator))
+ self.assertTrue(profile.done)
def test_bounds_iterator(self):
tp_config = {
def test_bounds_iterator(self):
tp_config = {