def METHOD_NAME(self):
    writer = tf.compat.v2.summary.create_file_writer(
        self.logdir,
        filename_suffix=".magic",
    )
    self._initialize_model(writer=writer)
    self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
    files = os.listdir(self.logdir)
    self.assertEqual(len(files), 1, files)
    filename = files[0]
    self.assertTrue(filename.endswith(".magic"), filename)
    # We'll assume that the contents are correct, as in the case where
    # the file writer was constructed implicitly.