code: def test_username_falls_back_to_pwd(self, environ):
      expected_name = "some_name"
      environ.get.return_value = None
      if pwd:
          with mock.patch("os.getuid") as uid, mock.patch(
              "pwd.getpwuid"
          ) as getpw:
              uid.return_value = 42
              getpw.return_value = [expected_name]
              self.assertEqual(expected_name, getpass.getuser())
              getpw.assert_called_once_with(42)
      else:
          self.assertRaises(OSError, getpass.getuser)
  
imports: import getpass
  import os
  import unittest
  from io import BytesIO, StringIO, TextIOWrapper
  from unittest import mock
  from test import support
label_desc: Use image node_id 3 for calling the GetpassGetuserTest obj's underlying member method code with example usage: obj.test_username_falls_back_to_pwd(environ) without return types