mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	fix dump table name error and add some test for dump database (#6394)
This commit is contained in:
		
				
					committed by
					
						 techknowlogick
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							75601a8cbc
						
					
				
				
					commit
					91dcccf72d
				
			| @@ -6,6 +6,9 @@ | ||||
| package models | ||||
|  | ||||
| import ( | ||||
| 	"io/ioutil" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| 	"testing" | ||||
|  | ||||
| 	"github.com/stretchr/testify/assert" | ||||
| @@ -93,3 +96,14 @@ func Test_getPostgreSQLConnectionString(t *testing.T) { | ||||
| 		assert.Equal(t, test.Output, connStr) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func TestDumpDatabase(t *testing.T) { | ||||
| 	assert.NoError(t, PrepareTestDatabase()) | ||||
|  | ||||
| 	dir, err := ioutil.TempDir(os.TempDir(), "dump") | ||||
| 	assert.NoError(t, err) | ||||
|  | ||||
| 	for _, dbType := range supportedDatabases { | ||||
| 		assert.NoError(t, DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType)) | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user