def setUp(self): super(DebuggerV2PluginTest, self).setUp() self.logdir = self.get_temp_dir() context = base_plugin.TBContext(logdir=self.logdir) self.plugin = debugger_v2_plugin.DebuggerV2Plugin(context) wsgi_app = application.TensorBoardWSGI([self.plugin]) self.server = werkzeug_test.Client(wsgi_app, wrappers.BaseResponse)
def setUp(self): super(DebuggerV2PluginTest, self).setUp() self.logdir = self.get_temp_dir() context = base_plugin.TBContext(logdir=self.logdir) self.plugin = debugger_v2_plugin.DebuggerV2Plugin(context) wsgi_app = application.TensorBoardWSGI([self.plugin]) self.server = werkzeug_test.Client(wsgi_app, wrappers.BaseResponse) # The multiplexer reads data asynchronously on a separate thread, so # as not to block the main thread of the TensorBoard backend. During # unit test, we disable the asynchronous behavior, so that we can # load the debugger data synchronously on the main thread and get # determinisic behavior in the tests. def run_in_background_mock(target): target() self.run_in_background_patch = tf.compat.v1.test.mock.patch.object( debug_data_multiplexer, "run_in_background", run_in_background_mock ) self.run_in_background_patch.start()
def testPluginIsNotActiveByDefault(self): dummy_logdir = tempfile.mkdtemp() context = base_plugin.TBContext(logdir=dummy_logdir) plugin = debugger_v2_plugin.DebuggerV2Plugin(context) self.assertFalse(plugin.is_active())
def testInstantiatePlugin(self): dummy_logdir = tempfile.mkdtemp() context = base_plugin.TBContext(logdir=dummy_logdir) plugin = debugger_v2_plugin.DebuggerV2Plugin(context) self.assertTrue(plugin)