mirror of
1
Fork 0

add file size checks

This commit is contained in:
tsmethurst 2022-01-23 15:52:18 +01:00
parent c157b1b20b
commit 3c1eb155e4
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,7 @@ func (suite *ManagerTestSuite) TestSimpleJpegProcessBlocking() {
Width: 512, Height: 288, Size: 147456, Aspect: 1.7777777777777777,
}, attachment.FileMeta.Small)
suite.Equal("image/jpeg", attachment.File.ContentType)
suite.Equal(269739, attachment.File.FileSize)
suite.Equal("LjBzUo#6RQR._NvzRjWF?urqV@a$", attachment.Blurhash)
// now make sure the attachment is in the database
@ -151,6 +152,7 @@ func (suite *ManagerTestSuite) TestSimpleJpegProcessAsync() {
Width: 512, Height: 288, Size: 147456, Aspect: 1.7777777777777777,
}, attachment.FileMeta.Small)
suite.Equal("image/jpeg", attachment.File.ContentType)
suite.Equal(269739, attachment.File.FileSize)
suite.Equal("LjBzUo#6RQR._NvzRjWF?urqV@a$", attachment.Blurhash)
// now make sure the attachment is in the database
@ -232,6 +234,7 @@ func (suite *ManagerTestSuite) TestSimpleJpegQueueSpamming() {
Width: 512, Height: 288, Size: 147456, Aspect: 1.7777777777777777,
}, attachment.FileMeta.Small)
suite.Equal("image/jpeg", attachment.File.ContentType)
suite.Equal(269739, attachment.File.FileSize)
suite.Equal("LjBzUo#6RQR._NvzRjWF?urqV@a$", attachment.Blurhash)
// now make sure the attachment is in the database