mirror of
https://github.com/curl/curl.git
synced 2026-07-24 17:07:16 +03:00
pytest: add tests for getting a non-existing ftp file
Check that return code is 78. Closes #18463
This commit is contained in:
parent
967a626af4
commit
9f1102cf74
3 changed files with 21 additions and 0 deletions
|
|
@ -215,6 +215,13 @@ class TestVsFTPD:
|
|||
r.check_stats(count=count, http_status=226)
|
||||
self.check_upload(env, vsftpd, docname=docname, binary=False)
|
||||
|
||||
def test_30_11_download_non_existing(self, env: Env, vsftpd: VsFTPD):
|
||||
curl = CurlClient(env=env)
|
||||
url = f'ftp://{env.ftp_domain}:{vsftpd.port}/does-not-exist'
|
||||
r = curl.ftp_get(urls=[url], with_stats=True)
|
||||
r.check_exit_code(78)
|
||||
r.check_stats(count=1, exitcode=78)
|
||||
|
||||
def check_downloads(self, client, srcfile: str, count: int,
|
||||
complete: bool = True):
|
||||
for i in range(count):
|
||||
|
|
|
|||
|
|
@ -246,6 +246,13 @@ class TestVsFTPD:
|
|||
expdata = [indata] if len(indata) else []
|
||||
assert expdata == destdata, f'expected: {expdata}, got: {destdata}'
|
||||
|
||||
def test_31_11_download_non_existing(self, env: Env, vsftpds: VsFTPD):
|
||||
curl = CurlClient(env=env)
|
||||
url = f'ftp://{env.ftp_domain}:{vsftpds.port}/does-not-exist'
|
||||
r = curl.ftp_ssl_get(urls=[url], with_stats=True)
|
||||
r.check_exit_code(78)
|
||||
r.check_stats(count=1, exitcode=78)
|
||||
|
||||
def check_downloads(self, client, srcfile: str, count: int,
|
||||
complete: bool = True):
|
||||
for i in range(count):
|
||||
|
|
|
|||
|
|
@ -258,6 +258,13 @@ class TestFtpsVsFTPD:
|
|||
expdata = [indata] if len(indata) else []
|
||||
assert expdata == destdata, f'expected: {expdata}, got: {destdata}'
|
||||
|
||||
def test_32_11_download_non_existing(self, env: Env, vsftpds: VsFTPD):
|
||||
curl = CurlClient(env=env)
|
||||
url = f'ftps://{env.ftp_domain}:{vsftpds.port}/does-not-exist'
|
||||
r = curl.ftp_get(urls=[url], with_stats=True)
|
||||
r.check_exit_code(78)
|
||||
r.check_stats(count=1, exitcode=78)
|
||||
|
||||
def check_downloads(self, client, srcfile: str, count: int,
|
||||
complete: bool = True):
|
||||
for i in range(count):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue