'test that simple removal of a flow works'

def test_handle_FlowRemoved(self):

    t = self.t
    t.flow_table.add_entry(TableEntry(priority=5, cookie=826366246, match=ofp_match(dl_src=EthAddr('00:00:00:00:00:01')), actions=[ofp_action_output(port=5)]))
    t.flow_table.add_entry(TableEntry(priority=5, cookie=826366247, match=ofp_match(dl_src=EthAddr('00:00:00:00:00:02')), actions=[ofp_action_output(port=6)]))
    self.assertEqual(len(t), 2)
    t._handle_FlowRemoved(FlowRemoved(self.conn, ofp_flow_removed(priority=5, cookie=826366246, match=ofp_match(dl_src=EthAddr('00:00:00:00:00:01')))))
    self.assertEqual(len(t), 1)
    self.assertEqual(t.entries[0].cookie, 826366247)
    for non_matching in [{'cookie': 826366246, 'match': ofp_match(dl_src=EthAddr('00:00:00:00:00:01'))}, {'cookie': 826366248, 'match': ofp_match(dl_src=EthAddr('00:00:00:00:00:02'))}, {'cookie': 826366247, 'match': ofp_match(dl_src=EthAddr('00:00:00:00:00:02'), nw_src=IPAddr('1.2.3.4'))}]:
        t._handle_FlowRemoved(FlowRemoved(self.conn, ofp_flow_removed(**non_matching)))
        self.assertEqual(len(t), 1)
        self.assertEqual(t.entries[0].cookie, 826366247)
