ultisuite-backend/internal/api/drive/service_quota_test.go
R3D347HR4Y bd7534658a Refactor and enhance unified frontend and API features
- Updated environment configuration to unify frontend for mail and drive under a single service.
- Revised README to reflect changes in frontend setup and routing for the unified application.
- Introduced new API documentation endpoints for better accessibility of API specifications.
- Enhanced drive and mail services with improved handling of file uploads and metadata enrichment.
- Implemented new API token management features, including creation, listing, and revocation of tokens.
- Added tests for new functionalities in drive and mail services to ensure reliability and correctness.
2026-06-07 15:44:30 +02:00

25 lines
579 B
Go

package drive
import "testing"
func TestQuotaAllowsUploadUnlimited(t *testing.T) {
if !quotaAllowsUpload(-3, 1<<30, 0) {
t.Fatal("negative free (unlimited) should allow upload")
}
}
func TestQuotaAllowsUploadZeroFree(t *testing.T) {
if quotaAllowsUpload(0, 1, 0) {
t.Fatal("zero free should block upload")
}
}
func TestQuotaAllowsUploadInsufficient(t *testing.T) {
if quotaAllowsUpload(100, 95, 10) {
t.Fatal("upload exceeding free+reserve should be blocked")
}
if !quotaAllowsUpload(100, 90, 10) {
t.Fatal("upload within free+reserve should be allowed")
}
}