diff options
author | Minoru TAKAHASHI <takahashi.minoru7@gmail.com> | 2015-06-30 16:23:39 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-30 17:00:24 +0900 |
commit | ebb69c8dadd768c5de359cdd15a34ac039c8be38 (patch) | |
tree | b290e15db5f3e59f19518988919c5cfa3cc68c3a | |
parent | 5250352b4efc3e7c2b9db97685a4821cf03d7999 (diff) |
test_ofctl: Fix dynamic addition of test cases
This unittest was not run from a certain time.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/unit/lib/test_ofctl.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ryu/tests/unit/lib/test_ofctl.py b/ryu/tests/unit/lib/test_ofctl.py index 27fb44ba..7e222e41 100644 --- a/ryu/tests/unit/lib/test_ofctl.py +++ b/ryu/tests/unit/lib/test_ofctl.py @@ -30,6 +30,7 @@ from ryu.lib import ofctl_v1_3 from ryu.ofproto import ofproto_v1_3, ofproto_v1_3_parser from ryu.ofproto import ofproto_protocol from ryu.ofproto import inet +from ryu.tests import test_lib LOG = logging.getLogger('test_ofctl_v1_2, v1_3') @@ -721,9 +722,7 @@ def _add_tests_actions(cls): cls_._test_actions(act, cls) print('adding %s ...' % method_name) func = functools.partial(_run, name=method_name, act=act, cls=cls) - func.func_name = method_name - func.__name__ = method_name - setattr(Test_ofctl, method_name, func) + test_lib.add_method(Test_ofctl, method_name, func) def _add_tests_match(cls): @@ -740,9 +739,7 @@ def _add_tests_match(cls): print('adding %s ...' % method_name) func = functools.partial( _run, name=method_name, attr=attr, cls=cls) - func.func_name = method_name - func.__name__ = method_name - setattr(Test_ofctl, method_name, func) + test_lib.add_method(Test_ofctl, method_name, func) """ Test case """ |