示例#1
0
 def test_update_port_status(self):
     plugin = TricirclePlugin()
     # this method requires a neutron context, but for test we just pass
     # a tricircle context
     port = plugin.update_port_status(context.Context(), FAKE_PORT_ID,
                                      neutron_const.PORT_STATUS_ACTIVE)
     self.assertEqual(FAKE_PORT['status'], neutron_const.PORT_STATUS_ACTIVE)
     self.assertIsNotNone(port)
示例#2
0
 def test_update_port_status_port_not_found(self):
     plugin = TricirclePlugin()
     port = plugin.update_port_status(context.Context(), 'no_such_port',
                                      neutron_const.PORT_STATUS_ACTIVE)
     self.assertEqual(FAKE_PORT['status'], neutron_const.PORT_STATUS_DOWN)
     self.assertIsNone(port)