


from unittest.mock import Mock, patch

from file_transfer.send_file import send_file


@patch("""socket.socket"""					)
@patch("""builtins.open"""					)
def    __lowerCamelCase   (      A__						: Any						,						A__						: Optional[int]					)     ->    List[Any]:
   lowerCamelCase_						:   List[str]		= Mock()
   lowerCamelCase_						:   Union[str, Any]		= conn, Mock()
   lowerCamelCase_						:   Union[str, Any]		= iter([1, None]					)
   lowerCamelCase_						:   int		= lambda A__					: next(__lowerCAmelCase					)

   # ===== invoke =====
   send_file(filename="""mytext.txt"""						,						testing=__lowerCAmelCase					)

   # ===== ensurance =====
   sock.assert_called_once()
   sock.return_value.bind.assert_called_once()
   sock.return_value.listen.assert_called_once()
   sock.return_value.accept.assert_called_once()
   conn.recv.assert_called_once()

   file.return_value.__enter__.assert_called_once()
   file.return_value.__enter__.return_value.read.assert_called()

   conn.send.assert_called_once()
   conn.close.assert_called_once()
   sock.return_value.shutdown.assert_called_once()
   sock.return_value.close.assert_called_once()






"""simple docstring"""


import os
from distutils.util import strtobool





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase							)				->   Union[str, Any]:




						'''simple docstring'''



						for e in env_keys:
												lowerCamelCase__   =int(os.environ.get(__lowerCAmelCase  ,       -1							)							)
												if val >= 0:
																		return val
						return default





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase=False							)				->   List[str]:




						'''simple docstring'''



						lowerCamelCase__   =os.environ.get(__lowerCAmelCase  ,       str(__lowerCAmelCase							)							)
						return strtobool(__lowerCAmelCase							) == 1  # As its name indicates `strtobool` actually returns an int...





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase="no"							)				->   Union[str, Any]:




						'''simple docstring'''



						lowerCamelCase__   =os.environ.get(__lowerCAmelCase  ,       str(__lowerCAmelCase							)							)
						return value


