'some checking of the bit-level wildcard magic in ofp_match'

def test_bit_wildcards(self):

    m = ofp_match()
    for (k, v) in ofp_match_data.iteritems():
        self.assertEquals(getattr(m, k), None, ('Attr    %s    should    be    wildcarded    and    reported    as    None' % k))
        self.assertEquals((m.wildcards & v[1]), v[1])
    for change in [('in_port', 1, OFPFW_IN_PORT), ('dl_vlan', 2, OFPFW_DL_VLAN), ('tp_dst', 22, OFPFW_TP_DST)]:
        setattr(m, change[0], change[1])
        self.assertEquals(getattr(m, change[0]), change[1], ('Attr    %s    should    have    been    set    to    %s' % change[0:2]))
        self.assertEquals((m.wildcards & change[2]), 0, ('with    %s    set    to    %s,    wildcard    bit    %x    should    get    unset' % change))
        setattr(m, change[0], None)
        self.assertEquals((m.wildcards & change[2]), change[2], ('with    %s    reset    from    %s,    wildcard    bit    %x    should    be    set    again' % change))
