On Fri, 1 Jun 2012 20:54:49 +0900 FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp> wrote:
> unittest crashes on commit e5e4b8442: > > ERROR: testInit (ryu.tests.unit.sample.test_simple_switch.TestSimpleSwitch) > > Traceback (most recent call last): > File > "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/tests/unit/sample/test_simple_switch.py", > line 20, in testInit > ss = SimpleSwitch() > File > "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/app/simple_switch.py", > line 44, in __init__ > self.mac2port = kwargs['mac2port'] > KeyError: 'mac2port' > > The simple_switch unittest doesn't test anything anyway so let's > remove it for now. > > Signed-off-by: FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp> > --- > ryu/tests/unit/sample/test_simple_switch.py | 21 --------------------- > 1 files changed, 0 insertions(+), 21 deletions(-) > delete mode 100644 ryu/tests/unit/sample/test_simple_switch.py Applied. I added a fix for a pep8 error to the simple_switch that the e5e4b8442 commit added: = >From d9856db46f6ff5ab71a367b70bcf469c168fbd38 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp> Date: Sat, 2 Jun 2012 05:20:12 +0900 Subject: [PATCH] discard sample/test_simple_switch because of unittest fail unittest crashes on commit e5e4b8442: ERROR: testInit (ryu.tests.unit.sample.test_simple_switch.TestSimpleSwitch) Traceback (most recent call last): File "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/tests/unit/sample/test_simple_switch.py", line 20, in testInit ss = SimpleSwitch() File "/var/lib/jenkins/jobs/ryu-test-upstream/workspace/ryu/app/simple_switch.py", line 44, in __init__ self.mac2port = kwargs['mac2port'] KeyError: 'mac2port' The simple_switch unittest doesn't test anything anyway so let's remove it for now. This also fixes a pip8 error of simple_switch.py that the commit e5e4b8442 added. Signed-off-by: FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp> --- ryu/app/simple_switch.py | 1 + ryu/tests/unit/sample/test_simple_switch.py | 21 --------------------- 2 files changed, 1 insertions(+), 21 deletions(-) delete mode 100644 ryu/tests/unit/sample/test_simple_switch.py diff --git a/ryu/app/simple_switch.py b/ryu/app/simple_switch.py index dce8fd7..16f26b9 100644 --- a/ryu/app/simple_switch.py +++ b/ryu/app/simple_switch.py @@ -39,6 +39,7 @@ class SimpleSwitch(app_manager.RyuApp): _CONTEXTS = { 'mac2port': mac_to_port.MacToPortTable, } + def __init__(self, *args, **kwargs): super(SimpleSwitch, self).__init__(*args, **kwargs) self.mac2port = kwargs['mac2port'] diff --git a/ryu/tests/unit/sample/test_simple_switch.py b/ryu/tests/unit/sample/test_simple_switch.py deleted file mode 100644 index 5fb7630..0000000 --- a/ryu/tests/unit/sample/test_simple_switch.py +++ /dev/null @@ -1,21 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -import unittest -from nose.tools import ok_, eq_ - -from ryu.app.simple_switch import SimpleSwitch - -import logging -LOG = logging.getLogger(__name__) - - -class TestSimpleSwitch(unittest.TestCase): - def setUp(self): - pass - - def tearDown(self): - pass - - def testInit(self): - ss = SimpleSwitch() - ok_(True) -- 1.7.4.4 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel