code: def test_raise_on_wrong_format(tmpdir):
      tmp_ipynb = str(tmpdir.join("notebook.ipynb"))
  
      cm = TextFileContentsManager()
      cm.root_dir = str(tmpdir)
  
      with pytest.raises(HTTPError):
          cm.save(
              path=tmp_ipynb,
              model=dict(
                  type="notebook",
                  content=new_notebook(
                      nbformat=4,
                      metadata=dict(jupytext_formats=[".doc"]),
                  ),
              ),
          )
  
file_path: jupytext/tests/functional/others/test_save_multiple.py
imports: import os
  import pytest
  from nbformat.v4.nbbase import new_notebook
  from nbformat.validator import NotebookValidationError
  from tornado.web import HTTPError
  import jupytext
  from jupytext.compare import compare_notebooks, notebook_model
  from jupytext.contentsmanager import TextFileContentsManager
label_desc: Use image node_id 5 for calling a global function with example usage: test_raise_on_wrong_format(tmpdir) without return types