code: def test_range_format_context(self):
      # Per the diff spec at http://www.unix.org/single_unix_specification/
      spec = """\
             The range of lines in file1 shall be written in the following format
             if the range contains two or more lines:
                 "*** %d,%d ****\n", <beginning line number>, <ending line number>
             and the following format otherwise:
                 "*** %d ****\n", <ending line number>
             The ending line number of an empty range shall be the number of the preceding line,
             or 0 if the range is at the start of the file.
  
             Next, the range of lines in file2 shall be written in the following format
             if the range contains two or more lines:
                 "--- %d,%d ----\n", <beginning line number>, <ending line number>
             and the following format otherwise:
                 "--- %d ----\n", <ending line number>
          """
      fmt = difflib._format_range_context
      self.assertEqual(fmt(3, 3), "3")
      self.assertEqual(fmt(3, 4), "4")
      self.assertEqual(fmt(3, 5), "4,5")
      self.assertEqual(fmt(3, 6), "4,6")
      self.assertEqual(fmt(0, 0), "0")
  
imports: import difflib
  from test.support import findfile
  import unittest
  import doctest
  import sys
label_desc: Use image node_id 4 for calling the TestOutputFormat obj's underlying member method code with example usage: obj.test_range_format_context() without return types