@@ -135,6 +135,16 @@ def frontend_metadata(self):
135135 )
136136
137137
138+ class FakePluginLoader (base_plugin .TBLoader ):
139+ """Pass-through loader for FakePlugin with arbitrary arguments."""
140+
141+ def __init__ (self , ** kwargs ):
142+ self ._kwargs = kwargs
143+
144+ def load (self , context ):
145+ return FakePlugin (context , ** self ._kwargs )
146+
147+
138148class ApplicationTest (tb_test .TestCase ):
139149 def setUp (self ):
140150 plugins = [
@@ -519,23 +529,21 @@ def setUp(self):
519529 self .app = application .standard_tensorboard_wsgi (
520530 FakeFlags (logdir = self .get_temp_dir ()),
521531 [
522- base_plugin .BasicLoader (functools .partial (
523- FakePlugin ,
524- plugin_name = 'foo' ,
525- is_active_value = True ,
526- routes_mapping = {'/foo_route' : self ._foo_handler },
527- construction_callback = self ._construction_callback )),
528- base_plugin .BasicLoader (functools .partial (
529- FakePlugin ,
530- plugin_name = 'bar' ,
531- is_active_value = True ,
532- routes_mapping = {
533- '/bar_route' : self ._bar_handler ,
534- '/wildcard/*' : self ._wildcard_handler ,
535- '/wildcard/special/*' : self ._wildcard_special_handler ,
536- '/wildcard/special/exact' : self ._foo_handler ,
537- },
538- construction_callback = self ._construction_callback )),
532+ FakePluginLoader (
533+ plugin_name = 'foo' ,
534+ is_active_value = True ,
535+ routes_mapping = {'/foo_route' : self ._foo_handler },
536+ construction_callback = self ._construction_callback ),
537+ FakePluginLoader (
538+ plugin_name = 'bar' ,
539+ is_active_value = True ,
540+ routes_mapping = {
541+ '/bar_route' : self ._bar_handler ,
542+ '/wildcard/*' : self ._wildcard_handler ,
543+ '/wildcard/special/*' : self ._wildcard_special_handler ,
544+ '/wildcard/special/exact' : self ._foo_handler ,
545+ },
546+ construction_callback = self ._construction_callback ),
539547 ],
540548 dummy_assets_zip_provider )
541549
0 commit comments