'Unit tests for the match_rules method.'

def test_match_rules(self):

    rules = ('*:*', 'Admin:%', 'Admin:*', 'Admin:Foo', 'Apps:Edit,Admin:*', 'Apps:Edit,Localizer:*,Admin:*')
    for rule in rules:
        assert match_rules(rule, 'Admin', '%'), ('%s    !=    Admin:%%' % rule)
    rules = ('Stats:View', 'Apps:Edit', 'None:None')
    for rule in rules:
        assert (not match_rules(rule, 'Admin', '%')), ("%s    ==    Admin:%%    and    shouldn't" % rule)
