diff --git a/examples/ftplib.py b/examples/ftplib.py index beaeb74af..6664ed001 100644 --- a/examples/ftplib.py +++ b/examples/ftplib.py @@ -1,9 +1,24 @@ from ftplib import FTP +from ftplib import FTP_TLS + +# bad ftp = FTP('ftp.debian.org') ftp.login() ftp.cwd('debian') ftp.retrlines('LIST') -ftp.quit() \ No newline at end of file +ftp.quit() + +# okay +ftp = ftplib.FTP_TLS( + "ftp.us.debian.org", + context=ssl.create_default_context(), +) +ftp.login() + +ftp.cwd("debian") +ftp.retrlines("LIST") + +ftp.quit() diff --git a/tests/functional/test_functional.py b/tests/functional/test_functional.py index fd96796f8..a92fe3f9c 100644 --- a/tests/functional/test_functional.py +++ b/tests/functional/test_functional.py @@ -246,8 +246,8 @@ def test_telnet_usage(self): def test_ftp_usage(self): """Test for `import ftplib` and FTP.* calls.""" expect = { - "SEVERITY": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 2}, - "CONFIDENCE": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 2}, + "SEVERITY": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 3}, + "CONFIDENCE": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 3}, } self.check_example("ftplib.py", expect)