def testPluginTagToContent_PluginsCannotJumpOnTheBandwagon(self):
# If there are multiple `SummaryMetadata` for a given tag, and the
# set of plugins in the `plugin_data` of second is different from
# that of the first, then the second set should be ignored.
logdir = self.get_temp_dir()
summary_metadata_1 = tf.SummaryMetadata(
display_name='current tagee',
summary_description='no',
plugin_data=tf.SummaryMetadata.PluginData(plugin_name='outlet',
content=b'120v'))
self._writeMetadata(logdir, summary_metadata_1, nonce='1')
acc = ea.EventAccumulator(logdir)
acc.Reload()
summary_metadata_2 = tf.SummaryMetadata(
display_name='tagee of the future',
summary_description='definitely not',
plugin_data=tf.SummaryMetadata.PluginData(plugin_name='plug',
content=b'110v'))
self._writeMetadata(logdir, summary_metadata_2, nonce='2')
acc.Reload()
self.assertEqual(acc.PluginTagToContent('outlet'),
{'you_are_it': b'120v'})
with six.assertRaisesRegex(self, KeyError, 'plug'):
acc.PluginTagToContent('plug')
评论列表
文章目录