File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ def stub(*args, **kwargs):
312312 raise TypeError (
313313 f"Error loading { entry_point .name } "
314314 f"from module { entry_point .module_name } : "
315- f"{ entry_point . cls .__name__ } must be a subclass of Stream"
315+ f"{ node . __class__ .__name__ } must be a subclass of Stream"
316316 )
317317 cls .register_api (
318318 modifier = modifier , attribute_name = entry_point .name
Original file line number Diff line number Diff line change @@ -53,3 +53,17 @@ class invalid_node:
5353
5454 with pytest .raises (TypeError ):
5555 Stream .test ()
56+
57+
58+ def test_register_plugin_entry_point_already_registered ():
59+ @Stream .register_api ()
60+ class test (Stream ):
61+ pass
62+
63+ entry_point = MockEntryPoint ("test_double" , test , "test_module" )
64+
65+ Stream .register_plugin_entry_point (entry_point )
66+
67+ assert Stream .test_double .__name__ == "stub"
68+ Stream .test_double ()
69+ assert Stream .test_double .__name__ == "test"
You can’t perform that action at this time.
0 commit comments