Kaynağa Gözat

测试用例修复

jinnrry 1 yıl önce
ebeveyn
işleme
587e9b7de8
2 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 7 0
      .github/workflows/unitTest.yml
  2. 2 2
      server/main_test.go

+ 7 - 0
.github/workflows/unitTest.yml

@@ -62,5 +62,12 @@ jobs:
       - name: Run Test
         run: make test
 
+      - uses: actions/upload-artifact@v4
+        with:
+          name: dbfile
+          path: server/config/pmail_temp.db
+
+
       - name: Run Test Mysql
         run: make test_mysql
+

+ 2 - 2
server/main_test.go

@@ -292,7 +292,7 @@ func testDataBaseSet(t *testing.T) {
 
 	if array.InArray("mysql", argList) {
 		configData = `
-{"action":"set","step":"database","db_type":"mysql","db_dsn":"root:githubTest@tcp(127.0.0.1:3306)/pmail?parseTime=True&loc=Local"}
+{"action":"set","step":"database","db_type":"mysql","db_dsn":"root:githubTest@tcp(127.0.0.1:3306)/pmail?parseTime=True"}
 `
 	}
 
@@ -716,7 +716,7 @@ func testEmailList(t *testing.T) {
 		t.Error("Get Email List Api Error!")
 	}
 	dt := data.Data.(map[string]interface{})
-	if len(dt["list"].([]interface{})) != 1 {
+	if len(dt["list"].([]interface{})) == 0 {
 		t.Error("Email List Is Empty!")
 	}