Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
0
 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")
Ejemplo n.º 3
0
 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))