docstr: If the zipfile is open for write, it should be possible to
  write bytes or text to it.
docstr_tok: ["If","the","zipfile","is","open","for","write",",","it","should","be","possible","to","write","bytes","or","text","to","it","."]
code: def test_open_write(self):
      """
      If the zipfile is open for write, it should be possible to
      write bytes or text to it.
      """
      zf = zipfile.Path(zipfile.ZipFile(io.BytesIO(), mode="w"))
      with zf.joinpath("file.bin").open("wb") as strm:
          strm.write(b"binary contents")
      with zf.joinpath("file.txt").open("w", encoding="utf-8") as strm:
          strm.write("text file")
  
imports: import io
  import itertools
  import contextlib
  import pathlib
  import pickle
  import sys
  import unittest
  import zipfile
  from ._functools import compose
  from ._itertools import Counter
  from ._test_params import parameterize, Invoked
  from test.support.os_helper import temp_dir
label_desc: Use image node_id 11 for calling the TestPath obj's underlying member method code with example usage: obj.test_open_write() without return types