'test that simple removal of a flow works'

def test_process_flow_mod_modify(self):

    c = self.conn
    s = self.switch
    def table():
        t = FlowTable()
        t.add_entry(TableEntry(priority=6, cookie=1, match=ofp_match(dl_src=EthAddr('00:00:00:00:00:01'), nw_src='1.2.3.4'), actions=[ofp_action_output(port=5)]))
        t.add_entry(TableEntry(priority=5, cookie=2, match=ofp_match(dl_src=EthAddr('00:00:00:00:00:02'), nw_src='1.2.3.0/24'), actions=[ofp_action_output(port=6)]))
        t.add_entry(TableEntry(priority=1, cookie=3, match=ofp_match(), actions=[]))
        return t
    s.table = table()
    t = s.table
    msg = ofp_flow_mod(command=OFPFC_MODIFY, match=ofp_match(), actions=[ofp_action_output(port=1)])
    c.to_switch(msg)
    self.assertEquals([e.cookie for e in t.entries if (e.actions == [ofp_action_output(port=1)])], [1, 2, 3])
    self.assertEquals(len(t.entries), 3)
    s.table = table()
    t = s.table
    msg = ofp_flow_mod(command=OFPFC_MODIFY, match=ofp_match(nw_src='1.2.0.0/16'), actions=[ofp_action_output(port=8)])
    c.to_switch(msg)
    self.assertEquals([e.cookie for e in t.entries if (e.actions == [ofp_action_output(port=8)])], [1, 2])
    self.assertEquals(len(t.entries), 3)
    s.table = table()
    t = s.table
    msg = ofp_flow_mod(cookie=5, command=OFPFC_MODIFY, match=ofp_match(nw_src='2.2.0.0/16'), actions=[ofp_action_output(port=8)])
    c.to_switch(msg)
    self.assertEquals(len(t.entries), 4)
    self.assertEquals([e.cookie for e in t.entries if (e.actions == [ofp_action_output(port=8)])], [5])
