def test_experiment_with_experiment_tag(self):
    experiment = "\n            description: 'Test experiment'\n            metric_infos: [\n              { name: { tag: 'current_temp' } }\n            ]\n        "
    run = 'exp'
    tag = metadata.EXPERIMENT_TAG
    m = summary_pb2.SummaryMetadata()
    m.data_class = summary_pb2.DATA_CLASS_TENSOR
    m.plugin_data.plugin_name = metadata.PLUGIN_NAME
    m.plugin_data.content = self._serialized_plugin_data(DATA_TYPE_EXPERIMENT, experiment)
    self._mock_multiplexer.AllSummaryMetadata.side_effect = None
    self._mock_multiplexer.AllSummaryMetadata.return_value = {run: {tag: m}}
    ctxt = backend_context.Context(self._mock_tb_context)
    request_ctx = context.RequestContext()
    self.assertProtoEquals(experiment, ctxt.experiment_from_metadata(request_ctx, '123', ctxt.hparams_metadata(request_ctx, '123')))
def test_experiment_with_experiment_tag(self):
    experiment = "\n            description: 'Test experiment'\n            metric_infos: [\n              { name: { tag: 'current_temp' } }\n            ]\n        "
    run = 'exp'
    tag = metadata.EXPERIMENT_TAG
    m = summary_pb2.SummaryMetadata()
    m.data_class = summary_pb2.DATA_CLASS_TENSOR
    m.plugin_data.plugin_name = metadata.PLUGIN_NAME
    m.plugin_data.content = self._serialized_plugin_data(DATA_TYPE_EXPERIMENT, experiment)
    self._mock_multiplexer.AllSummaryMetadata.side_effect = None
    self._mock_multiplexer.AllSummaryMetadata.return_value = {run: {tag: m}}
    ctxt = backend_context.Context(self._mock_tb_context)
    request_ctx = context.RequestContext()
    self.assertProtoEquals(experiment, ctxt.experiment_from_metadata(request_ctx, '123', ctxt.hparams_metadata(request_ctx, '123')))