code: def test_fieldwriter_single_term():
      field = fields.TEXT()
      st, codec, seg = _make_codec()
  
      fw = codec.field_writer(st, seg)
      fw.start_field("text", field)
      fw.start_term(b("alfa"))
      fw.add(0, 1.5, b("test"), 1)
      fw.finish_term()
      fw.finish_field()
      fw.close()
  
      tr = codec.terms_reader(st, seg)
      assert ("text", b("alfa")) in tr
      ti = tr.term_info("text", b("alfa"))
      assert ti.weight() == 1.5
      assert ti.doc_frequency() == 1
      assert ti.min_length() == 1
      assert ti.max_length() == 1
      assert ti.max_weight() == 1.5
      assert ti.min_id() == 0
      assert ti.max_id() == 0
  
imports: from __future__ import with_statement
  import random
  from array import array
  import pytest
  from whoosh import analysis, fields, formats, query
  from whoosh.compat import u, b, text_type
  from whoosh.compat import array_tobytes, xrange
  from whoosh.codec import default_codec
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 12 for calling a global function with example usage: test_fieldwriter_single_term() without return types