Ejemplo n.º 1
0
 def setUp(self):
     super(TestUnsetRouter, self).setUp()
     self.fake_network = network_fakes.FakeNetwork.create_one_network()
     self.fake_qos_policy = (
         network_fakes.FakeNetworkQosPolicy.create_one_qos_policy())
     self._testrouter = network_fakes.FakeRouter.create_one_router({
         'routes': [{
             "destination": "192.168.101.1/24",
             "nexthop": "172.24.4.3"
         }, {
             "destination": "192.168.101.2/24",
             "nexthop": "172.24.4.3"
         }],
         'tags': ['green', 'red'],
         'external_gateway_info': {
             'network_id': self.fake_network.id,
             'qos_policy_id': self.fake_qos_policy.id
         }
     })
     self.fake_subnet = network_fakes.FakeSubnet.create_one_subnet()
     self.network.find_router = mock.Mock(return_value=self._testrouter)
     self.network.update_router = mock.Mock(return_value=None)
     self.network.set_tags = mock.Mock(return_value=None)
     # Get the command object to test
     self.cmd = router.UnsetRouter(self.app, self.namespace)
Ejemplo n.º 2
0
 def setUp(self):
     super(TestUnsetRouter, self).setUp()
     self._testrouter = network_fakes.FakeRouter.create_one_router(
         {'routes': [{"destination": "192.168.101.1/24",
                      "gateway": "172.24.4.3"},
                     {"destination": "192.168.101.2/24",
                      "gateway": "172.24.4.3"}], })
     self.fake_subnet = network_fakes.FakeSubnet.create_one_subnet()
     self.network.find_router = mock.Mock(return_value=self._testrouter)
     self.network.update_router = mock.Mock(return_value=None)
     # Get the command object to test
     self.cmd = router.UnsetRouter(self.app, self.namespace)