code: def test_do_longs(self):
      opts, args = getopt.do_longs([], "abc", ["abc"], [])
      self.assertEqual(opts, [("--abc", "")])
      self.assertEqual(args, [])
  
      opts, args = getopt.do_longs([], "abc=1", ["abc="], [])
      self.assertEqual(opts, [("--abc", "1")])
      self.assertEqual(args, [])
  
      opts, args = getopt.do_longs([], "abc=1", ["abcd="], [])
      self.assertEqual(opts, [("--abcd", "1")])
      self.assertEqual(args, [])
  
      opts, args = getopt.do_longs([], "abc", ["ab", "abc", "abcd"], [])
      self.assertEqual(opts, [("--abc", "")])
      self.assertEqual(args, [])
  
      # Much like the preceding, except with a non-alpha character ("-") in
      # option name that precedes "="; failed in
      # https://bugs.python.org/issue126863
      opts, args = getopt.do_longs(
          [],
          "foo=42",
          [
              "foo-bar",
              "foo=",
          ],
          [],
      )
      self.assertEqual(opts, [("--foo", "42")])
      self.assertEqual(args, [])
  
      self.assertError(getopt.do_longs, [], "abc=1", ["abc"], [])
      self.assertError(getopt.do_longs, [], "abc", ["abc="], [])
  
file_path: cpython/Lib/test/test_getopt.py
imports: from test.support.os_helper import EnvironmentVarGuard
  import doctest
  import unittest
  import getopt
label_desc: Use image node_id 6 for calling the GetoptTests obj's underlying member method code with example usage: obj.test_do_longs() without return types