1 # Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation.
2 # Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from nose.tools import eq_, raises
24 from imp import reload
29 from ryu.cmd.manager import main
32 class Test_Manager(unittest.TestCase):
33 """Test ryu-manager command
36 def __init__(self, methodName):
37 super(Test_Manager, self).__init__(methodName)
46 @mock.patch('sys.argv', new=['ryu-manager', '--version'])
47 def test_version(self):
51 @mock.patch('sys.argv', new=['ryu-manager', '--help'])
57 # hack to reset globals like SERVICE_BRICKS.
58 # assumption: this is the only test which actually starts RyuApp.
59 import ryu.base.app_manager
60 import ryu.ofproto.ofproto_protocol
62 reload(ryu.base.app_manager)
63 reload(ryu.ofproto.ofproto_protocol)
65 @mock.patch('sys.argv', new=['ryu-manager', '--verbose',
66 'ryu.tests.unit.cmd.dummy_app'])
67 def test_no_services(self):
72 @mock.patch('sys.argv', new=['ryu-manager', '--verbose',
73 'ryu.tests.unit.cmd.dummy_openflow_app'])
74 def test_openflow_app(self):