



from unittest.mock import Mock, patch

from file_transfer.send_file import send_file






@patch('''socket.socket''')
@patch('''builtins.open''')
def 			lowerCAmelCase__	(					lowerCamelCase_	:	List[Any] ,lowerCamelCase_	:	Optional[Any]):





				'''simple docstring'''

				lowerCAmelCase__  :       Optional[Any]				=  Mock()
				lowerCAmelCase__  :       Dict				=  conn, Mock()
				lowerCAmelCase__  :       int				=  iter([1, None])
				lowerCAmelCase__  :       List[str]				=  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 			lowerCAmelCase__	(					lowerCamelCase_	:	int):





				'''simple docstring'''

				if length <= 0 or not isinstance(lowerCamelCase_ ,lowerCamelCase_):
								raise ValueError('''Length must be a positive integer.''')
				return [n * (2 * n - 1) for n in range(lowerCamelCase_)]


if __name__ == "__main__":
							print(hexagonal_numbers(length=5))
							print(hexagonal_numbers(length=1_0))

