def test_get_rule_from_predefined_rules(): r = Richtypo() rule = r._get_rule(ABRule) assert rule == ABRule
def test_get_rule_from_available(): r = Richtypo() r.available_rules = {'b': Rule(pattern='b', replacement='d')} rule = r._get_rule('b') assert rule.pattern == 'b'