



from unittest.mock import Mock, patch

from file_transfer.send_file import send_file




@patch("""socket.socket"""		)
@patch("""builtins.open"""		)
def 	__UpperCamelCase	(  _lowerCAmelCase      ,     _lowerCAmelCase		)       ->  List[Any]:



    """simple docstring"""






    A :       Optional[int]          =   Mock()
    A :       List[str]          =   conn, Mock()
    A :       str          =   iter([1, None]		)
    A :       int          =   lambda _lowerCAmelCase		: 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()







def 	__UpperCamelCase	(  _lowerCAmelCase		)       ->  list:



    """simple docstring"""






    return [
        txt[:a] + txt[a].upper() + txt[a + 1 :]
        for a in range(len(_lowerCAmelCase		)		)
        if txt[a].isalpha()
    ]


if __name__ == "__main__":
     __import__("""doctest""").testmod()


