Skip to content

Commit

Permalink
restructured ADRs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmueller committed Dec 21, 2024
1 parent cccdce2 commit 257f886
Show file tree
Hide file tree
Showing 8 changed files with 1,106 additions and 15 deletions.
Empty file modified docs/arc42/decisions/ADR-001-rule-base-class.adoc
100644 → 100755
Empty file.
Empty file modified docs/arc42/decisions/ADR-001-rule-base-class.adoc.meta
100644 → 100755
Empty file.
Empty file modified docs/arc42/decisions/ADR-002-finding-data-structure.adoc
100644 → 100755
Empty file.
Empty file modified docs/arc42/decisions/ADR-002-finding-data-structure.adoc.meta
100644 → 100755
Empty file.
Empty file modified docs/arc42/decisions/ADR-003-rule-implementation-strategy.adoc
100644 → 100755
Empty file.
Empty file.
1,091 changes: 1,091 additions & 0 deletions docs/test-results/test-report.html

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions tests/test_rule_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import pytest
from asciidoc_linter.rules.base import Rule, RuleRegistry, Severity

class TestRuleOne(Rule):
class MockRuleOne(Rule):
"""First test rule"""
id = "TestRuleOne"
name = "Test Rule One"
description = "First test rule"
id = "MockRuleOne"
name = "Mock Rule One"
description = "First mock rule"
severity = Severity.WARNING

class TestRuleTwo(Rule):
class MockRuleTwo(Rule):
"""Second test rule"""
id = "TestRuleTwo"
name = "Test Rule Two"
description = "Second test rule"
id = "MockRuleTwo"
name = "Mock Rule Two"
description = "Second mock rule"
severity = Severity.ERROR

def test_rule_registry():
Expand All @@ -24,18 +24,18 @@ def test_rule_registry():
RuleRegistry._rules.clear()

# Test registration
RuleRegistry.register_rule(TestRuleOne)
RuleRegistry.register_rule(TestRuleTwo)
RuleRegistry.register_rule(MockRuleOne)
RuleRegistry.register_rule(MockRuleTwo)

# Test getting a specific rule
rule_class = RuleRegistry.get_rule("TestRuleOne")
assert rule_class == TestRuleOne
rule_class = RuleRegistry.get_rule("MockRuleOne")
assert rule_class == MockRuleOne

# Test getting all rules
all_rules = RuleRegistry.get_all_rules()
assert len(all_rules) == 2
assert TestRuleOne in all_rules
assert TestRuleTwo in all_rules
assert MockRuleOne in all_rules
assert MockRuleTwo in all_rules

# Test creating all rules
rule_instances = RuleRegistry.create_all_rules()
Expand All @@ -45,4 +45,4 @@ def test_rule_registry():

# Test getting non-existent rule
with pytest.raises(KeyError):
RuleRegistry.get_rule("NonExistentRule")
RuleRegistry.get_rule("NonExistentRule")

0 comments on commit 257f886

Please sign in to comment.