Simplify storage test assumptions

This commit is contained in:
Torsten Dittmann
2026-05-15 21:12:14 +04:00
parent e873f02b94
commit 27bf229524
+2 -8
View File
@@ -11,8 +11,6 @@ use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Query;
use Utopia\Database\Validator\Datetime as DatetimeValidator;
use Utopia\Storage\Storage;
use Utopia\System\System;
trait StorageBase
{
@@ -289,11 +287,7 @@ trait StorageBase
$this->assertEquals('large-file.mp4', $largeFile['body']['name']);
$this->assertEquals('video/mp4', $largeFile['body']['mimeType']);
$this->assertEquals($totalSize, $largeFile['body']['sizeOriginal']);
if (System::getEnv('_APP_STORAGE_DEVICE') === Storage::DEVICE_S3 || str_starts_with(System::getEnv('_APP_CONNECTIONS_STORAGE', ''), Storage::DEVICE_S3 . '://')) {
$this->assertNotEmpty($largeFile['body']['signature']);
} else {
$this->assertEquals(md5_file(realpath(__DIR__ . '/../../../resources/disk-a/large-file.mp4')), $largeFile['body']['signature']); // should validate that the file is not encrypted
}
$this->assertEquals(md5_file(realpath(__DIR__ . '/../../../resources/disk-a/large-file.mp4')), $largeFile['body']['signature']); // should validate that the file is not encrypted
/**
* Failure
@@ -397,7 +391,7 @@ trait StorageBase
'bucketId' => ID::unique(),
'name' => 'Test Bucket 2',
'fileSecurity' => true,
'maximumFileSize' => ((int) System::getEnv('_APP_STORAGE_LIMIT', 0) ?: 6000000000) + 1,
'maximumFileSize' => 6000000001,
'allowedFileExtensions' => ["jpg", "png"],
'permissions' => [
Permission::read(Role::any()),