mirror of
				https://github.com/gofiber/storage.git
				synced 2025-10-31 19:52:45 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			568 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			568 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package s3
 | |
| 
 | |
| import (
 | |
| 	"os"
 | |
| 	"testing"
 | |
| 	"time"
 | |
| )
 | |
| 
 | |
| const (
 | |
| 	bucket = "testbucket"
 | |
| )
 | |
| 
 | |
| var testStore *Storage
 | |
| 
 | |
| func TestMain(m *testing.M) {
 | |
| 	testStore = New(
 | |
| 		Config{
 | |
| 			Bucket:   bucket,
 | |
| 			Endpoint: "http://127.0.0.1:9000/",
 | |
| 			Region:   "us-east-1",
 | |
| 			Credentials: Credentials{
 | |
| 				AccessKey:       "minio-user",
 | |
| 				SecretAccessKey: "minio-password",
 | |
| 			},
 | |
| 			RequestTimeout: 3 * time.Second,
 | |
| 		},
 | |
| 	)
 | |
| 
 | |
| 	// Create test bucket.
 | |
| 	_ = testStore.CreateBucket(bucket)
 | |
| 
 | |
| 	exitVal := m.Run()
 | |
| 
 | |
| 	// Delete test bucket.
 | |
| 	_ = testStore.DeleteBucket(bucket)
 | |
| 
 | |
| 	os.Exit(exitVal)
 | |
| }
 | 
