()
| 751 | self.client.quit() |
| 752 | |
| 753 | def is_client_connected(): |
| 754 | if self.client.sock is None: |
| 755 | return False |
| 756 | try: |
| 757 | self.client.sendcmd('noop') |
| 758 | except (OSError, EOFError): |
| 759 | return False |
| 760 | return True |
| 761 | |
| 762 | # base test |
| 763 | with ftplib.FTP(timeout=TIMEOUT) as self.client: |