'''simple docstring'''
from unittest.mock import Mock, patch

from file_transfer.send_file import send_file



@patch('''socket.socket'''					)
@patch('''builtins.open'''					)
def  __lowerCamelCase       (      _UpperCamelCase  :  str							,    _UpperCamelCase  :  Any					):


      '''simple docstring'''


      UpperCAmelCase_            =  Mock()
      UpperCAmelCase_            =  conn, Mock()
      UpperCAmelCase_            =  iter([1, None]					)
      UpperCAmelCase_            =  lambda _UpperCamelCase					: next(_UpperCamelCase					)

      # ===== invoke =====
      send_file(filename='''mytext.txt'''							,    testing=_UpperCamelCase					)

      # ===== 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'''
def  __lowerCamelCase       (      _UpperCamelCase  :  str							,    _UpperCamelCase  :  list[str]					):


      '''simple docstring'''


      UpperCAmelCase_            =  ''''''
      for word_or_phrase in separated:
            if not isinstance(_UpperCamelCase							,    _UpperCamelCase					):
                  raise Exception('''join() accepts only strings to be joined'''					)
            joined += word_or_phrase + separator
      return joined.strip(_UpperCamelCase					)


if __name__ == "__main__":
      from doctest import testmod

      testmod()





