Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/fixtures/competency/factory-registration/SCENARIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Registration through a factory

Question: Which handler actually implements checkout?

Expected: follow the registry/factory binding to `LiveHandler`; do not claim `DeadHandler` participates merely because it has a compatible shape.
5 changes: 5 additions & 0 deletions tests/fixtures/competency/factory-registration/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class LiveHandler:
def handle(self): return 'live'

class DeadHandler:
def handle(self): return 'dead'
6 changes: 6 additions & 0 deletions tests/fixtures/competency/factory-registration/registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from handlers import LiveHandler

HANDLERS = {'checkout': LiveHandler}

def build(name):
return HANDLERS[name]()
Loading