code: def test_truncate_text():
      text = "lorem ipsum"
      length = 5
  
      truncated = truncate_text(text, length)
      # length should not cross the max length
      assert len(truncated) == length
      assert truncated[:-1] == text[: length - 1]
      # last character should be ellipsis
      assert truncated[-1] == "…"
  
      truncated = truncate_text(text, length, with_ellipsis=False)
      # length should not cross the max length
      assert len(truncated) == length
      assert truncated == text[:length]
  
imports: from collections import OrderedDict
  import pytest
  from dvc.utils.humanize import get_summary, truncate_text
label_desc: Use image node_id 2 for calling a global function with example usage: test_truncate_text() without return types