From ebb69c8dadd768c5de359cdd15a34ac039c8be38 Mon Sep 17 00:00:00 2001 From: Minoru TAKAHASHI Date: Tue, 30 Jun 2015 16:23:39 +0900 Subject: [PATCH] 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 Signed-off-by: FUJITA Tomonori --- ryu/tests/unit/lib/test_ofctl.py | 9 +++------ 1 file 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 """