11"""Tests for IDGenerator abstract base class."""
2+
23import uuid
34
45from unittest .mock import patch
@@ -19,7 +20,9 @@ class TestIDGeneratorContext:
1920
2021 def test_context_creation_with_all_fields (self ):
2122 """Test creating context with all fields populated."""
22- context = IDGeneratorContext (task_id = 'task_123' , context_id = 'context_456' )
23+ context = IDGeneratorContext (
24+ task_id = 'task_123' , context_id = 'context_456'
25+ )
2326 assert context .task_id == 'task_123'
2427 assert context .context_id == 'context_456'
2528
@@ -44,7 +47,7 @@ def test_context_mutability(self):
4447 def test_context_validation (self ):
4548 """Test that context raises validation error for invalid types."""
4649 with pytest .raises (ValidationError ):
47- IDGeneratorContext (task_id = {" not" : " a string" }) # noqa
50+ IDGeneratorContext (task_id = {' not' : ' a string' }) # noqa
4851
4952
5053class TestIDGenerator :
@@ -130,7 +133,9 @@ def test_generate_with_empty_context(self):
130133 def test_generate_with_populated_context (self ):
131134 """Test that generate works with a populated context."""
132135 generator = UUIDGenerator ()
133- context = IDGeneratorContext (task_id = 'task_123' , context_id = 'context_456' )
136+ context = IDGeneratorContext (
137+ task_id = 'task_123' , context_id = 'context_456'
138+ )
134139 result = generator .generate (context )
135140 assert isinstance (result , str )
136141 uuid .UUID (result )
0 commit comments