def test_get_file_with_tgz_extension(self):
        """Test extraction of file with .tar.gz extension."""
        dest_dir = self.get_temp_dir()
        orig_dir = dest_dir
        _, tar_file_path = self._create_tar_file(orig_dir)

        origin = urllib.parse.urljoin(
            "file://",
            urllib.request.pathname2url(os.path.abspath(tar_file_path)),
        )

        path = file_utils.get_file(
            "test.txt.tar.gz", origin, untar=True, cache_subdir=dest_dir
        )
        self.assertTrue(os.path.exists(path))
        self.assertTrue(os.path.exists(os.path.join(path, "test.txt")))
Test extraction of file with .tar.gz extension.
keras/src/utils/file_utils_test.py