code: def test_do_shorts(self):
      opts, args = getopt.do_shorts([], "a", "a", [])
      self.assertEqual(opts, [("-a", "")])
      self.assertEqual(args, [])
  
      opts, args = getopt.do_shorts([], "a1", "a:", [])
      self.assertEqual(opts, [("-a", "1")])
      self.assertEqual(args, [])
  
      # opts, args = getopt.do_shorts([], 'a=1', 'a:', [])
      # self.assertEqual(opts, [('-a', '1')])
      # self.assertEqual(args, [])
  
      opts, args = getopt.do_shorts([], "a", "a:", ["1"])
      self.assertEqual(opts, [("-a", "1")])
      self.assertEqual(args, [])
  
      opts, args = getopt.do_shorts([], "a", "a:", ["1", "2"])
      self.assertEqual(opts, [("-a", "1")])
      self.assertEqual(args, ["2"])
  
      self.assertError(getopt.do_shorts, [], "a1", "a", [])
      self.assertError(getopt.do_shorts, [], "a", "a:", [])
  
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 5 for calling the GetoptTests obj's underlying member method code with example usage: obj.test_do_shorts() without return types