Browse Source

Merge pull request #38 from digineo/test_pasv

Test PASV as well
Julien Laffaye 10 years ago
parent
commit
fb305c5912
1 changed files with 13 additions and 1 deletions
  1. 13 1
      client_test.go

+ 13 - 1
client_test.go

@@ -13,7 +13,15 @@ const (
 	testDir  = "mydir"
 	testDir  = "mydir"
 )
 )
 
 
-func TestConn(t *testing.T) {
+func TestConnPASV(t *testing.T) {
+	testConn(t, true)
+}
+
+func TestConnEPSV(t *testing.T) {
+	testConn(t, false)
+}
+
+func testConn(t *testing.T, passive bool) {
 	if testing.Short() {
 	if testing.Short() {
 		t.Skip("skipping test in short mode.")
 		t.Skip("skipping test in short mode.")
 	}
 	}
@@ -23,6 +31,10 @@ func TestConn(t *testing.T) {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 
 
+	if passive {
+		delete(c.features, "EPSV")
+	}
+
 	err = c.Login("anonymous", "anonymous")
 	err = c.Login("anonymous", "anonymous")
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)