def test_ftp_invalid_auth(self): with pytest.raises(ConanException) as exc: conanfile = ConanFileMock() ftp_download(conanfile, "test.rebex.net", "readme.txt", "demo", "invalid") assert "530 User cannot log in." in str(exc.value) assert not os.path.exists("readme.txt")
def test_ftp_invalid_path(self): with pytest.raises(ConanException) as exc: conanfile = ConanFileMock() ftp_download(conanfile, "test.rebex.net", "invalid-file", "demo", "password") assert "550 The system cannot find the file specified." in str( exc.value) assert not os.path.exists("invalid-file")
def test_ftp_auth(self): filename = "/pub/example/readme.txt" conanfile = ConanFileMock() ftp_download(conanfile, "test.rebex.net", filename, "demo", "password") assert os.path.exists(os.path.basename(filename))