restruct test_rule.py