def test_get_or_create_ofport_missing_nocreate(self):
    port_dict = {'device': 'port-id', 'security_groups': [123, 456]}
    self.mock_bridge.br.get_vif_port_by_id.return_value = None
    self.assertIsNone(self.firewall.get_ofport(port_dict))
    self.assertFalse(self.mock_bridge.br.get_vif_port_by_id.called)
def test_get_or_create_ofport_missing_nocreate(self):
    port_dict = {'device': 'port-id', 'security_groups': [123, 456]}
    self.mock_bridge.br.get_vif_port_by_id.return_value = None
    self.assertIsNone(self.firewall.get_ofport(port_dict))
    self.assertFalse(self.mock_bridge.br.get_vif_port_by_id.called)