code: def test_line_endings(self):
      # test for bug #1172763: dumbdbm would die if the line endings
      # weren't what was expected.
      with contextlib.closing(dumbdbm.open(_fname)) as f:
          f[b"1"] = b"hello"
          f[b"2"] = b"hello2"
  
      # Mangle the file by changing the line separator to Windows or Unix
      with io.open(_fname + ".dir", "rb") as file:
          data = file.read()
      if os.linesep == "\n":
          data = data.replace(b"\n", b"\r\n")
      else:
          data = data.replace(b"\r\n", b"\n")
      with io.open(_fname + ".dir", "wb") as file:
          file.write(data)
  
      f = dumbdbm.open(_fname)
      self.assertEqual(f[b"1"], b"hello")
      self.assertEqual(f[b"2"], b"hello2")
  
imports: import contextlib
  import io
  import operator
  import os
  import stat
  import unittest
  import dbm.dumb
  from test import support
  from test.support import os_helper
  from functools import partial
label_desc: Use image node_id 11 for calling the DumbDBMTestCase obj's underlying member method code with example usage: obj.test_line_endings() without return types