2121
2222class TestAccelerator (Accelerator ):
2323 """Helper accelerator class for testing."""
24-
24+
2525 def __init__ (self , param1 = None , param2 = None ):
2626 self .param1 = param1
2727 self .param2 = param2
@@ -108,19 +108,19 @@ def test_available_accelerators_in_registry():
108108def test_registry_as_decorator ():
109109 """Test that the registry can be used as a decorator."""
110110 test_registry = _AcceleratorRegistry ()
111-
111+
112112 # Test decorator usage
113113 @test_registry .register ("test_decorator" , description = "Test decorator accelerator" , param1 = "value1" , param2 = 42 )
114114 class DecoratorAccelerator (TestAccelerator ):
115115 pass
116-
116+
117117 # Verify registration worked
118118 assert "test_decorator" in test_registry
119119 assert test_registry ["test_decorator" ]["description" ] == "Test decorator accelerator"
120120 assert test_registry ["test_decorator" ]["init_params" ] == {"param1" : "value1" , "param2" : 42 }
121121 assert test_registry ["test_decorator" ]["accelerator" ] == DecoratorAccelerator
122122 assert test_registry ["test_decorator" ]["accelerator_name" ] == "test_decorator"
123-
123+
124124 # Test that we can instantiate the accelerator
125125 instance = test_registry .get ("test_decorator" )
126126 assert isinstance (instance , DecoratorAccelerator )
@@ -131,27 +131,27 @@ class DecoratorAccelerator(TestAccelerator):
131131def test_registry_as_static_method ():
132132 """Test that the registry can be used as a static method call."""
133133 test_registry = _AcceleratorRegistry ()
134-
134+
135135 class StaticMethodAccelerator (TestAccelerator ):
136136 pass
137-
137+
138138 # Test static method usage
139139 result = test_registry .register (
140- "test_static" ,
141- StaticMethodAccelerator ,
142- description = "Test static method accelerator" ,
143- param1 = "static_value" ,
144- param2 = 100
140+ "test_static" ,
141+ StaticMethodAccelerator ,
142+ description = "Test static method accelerator" ,
143+ param1 = "static_value" ,
144+ param2 = 100 ,
145145 )
146-
146+
147147 # Verify registration worked
148148 assert "test_static" in test_registry
149149 assert test_registry ["test_static" ]["description" ] == "Test static method accelerator"
150150 assert test_registry ["test_static" ]["init_params" ] == {"param1" : "static_value" , "param2" : 100 }
151151 assert test_registry ["test_static" ]["accelerator" ] == StaticMethodAccelerator
152152 assert test_registry ["test_static" ]["accelerator_name" ] == "test_static"
153153 assert result == StaticMethodAccelerator # Should return the accelerator class
154-
154+
155155 # Test that we can instantiate the accelerator
156156 instance = test_registry .get ("test_static" )
157157 assert isinstance (instance , StaticMethodAccelerator )
@@ -162,16 +162,16 @@ class StaticMethodAccelerator(TestAccelerator):
162162def test_registry_without_parameters ():
163163 """Test registration without init parameters."""
164164 test_registry = _AcceleratorRegistry ()
165-
165+
166166 class SimpleAccelerator (TestAccelerator ):
167167 def __init__ (self ):
168168 super ().__init__ ()
169-
169+
170170 test_registry .register ("simple" , SimpleAccelerator , description = "Simple accelerator" )
171-
171+
172172 assert "simple" in test_registry
173173 assert test_registry ["simple" ]["description" ] == "Simple accelerator"
174174 assert test_registry ["simple" ]["init_params" ] == {}
175-
175+
176176 instance = test_registry .get ("simple" )
177177 assert isinstance (instance , SimpleAccelerator )
0 commit comments