mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net.ftp: make ftp's tests just compile (not run) on CI
This commit is contained in:

committed by
Alexander Medvednikov

parent
48585e54df
commit
68e1d8e8eb
@@ -2,31 +2,36 @@ module main
|
||||
|
||||
import net.ftp
|
||||
|
||||
fn test_all() {
|
||||
fn test_ftp_client() {
|
||||
make_client_connection()
|
||||
assert true
|
||||
}
|
||||
|
||||
// NB: this function makes network calls to external servers,
|
||||
// that is why it is not a very good idea to run it in CI.
|
||||
// If you want to run it manually, use `v -d network vlib/net/ftp/ftp_test.v`
|
||||
[if network]
|
||||
fn make_client_connection() {
|
||||
mut ftp := ftp.new()
|
||||
defer {
|
||||
ftp.close()
|
||||
}
|
||||
|
||||
assert ftp.connect('ftp.redhat.com')
|
||||
assert ftp.login('ftp','ftp')
|
||||
|
||||
assert ftp.login('ftp', 'ftp')
|
||||
pwd := ftp.pwd()
|
||||
|
||||
assert pwd.len > 0
|
||||
ftp.cd('/')
|
||||
dir_list1 := ftp.dir() or {
|
||||
assert false
|
||||
return
|
||||
}
|
||||
assert dir_list1.len > 0
|
||||
|
||||
ftp.cd('/suse/linux/enterprise/11Server/en/SAT-TOOLS/SRPMS/')
|
||||
dir_list2 := ftp.dir() or {
|
||||
assert false
|
||||
return
|
||||
}
|
||||
assert dir_list2.len > 0
|
||||
|
||||
blob := ftp.get('katello-host-tools-3.3.5-8.sles11_4sat.src.rpm') or {
|
||||
assert false
|
||||
return
|
||||
|
Reference in New Issue
Block a user