mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-22 19:33:27 +01:00
Fix brittle test
This commit is contained in:
parent
b0a07af28d
commit
207e990798
1 changed files with 1 additions and 1 deletions
|
@ -870,7 +870,7 @@ func TestServer_PublishAttachment(t *testing.T) {
|
||||||
require.Equal(t, "attachment.txt", msg.Attachment.Name)
|
require.Equal(t, "attachment.txt", msg.Attachment.Name)
|
||||||
require.Equal(t, "text/plain; charset=utf-8", msg.Attachment.Type)
|
require.Equal(t, "text/plain; charset=utf-8", msg.Attachment.Type)
|
||||||
require.Equal(t, int64(5000), msg.Attachment.Size)
|
require.Equal(t, int64(5000), msg.Attachment.Size)
|
||||||
require.GreaterOrEqual(t, msg.Attachment.Expires, time.Now().Add(3*time.Hour).Unix())
|
require.GreaterOrEqual(t, msg.Attachment.Expires, time.Now().Add(179*time.Minute).Unix()) // Almost 3 hours
|
||||||
require.Contains(t, msg.Attachment.URL, "http://127.0.0.1:12345/file/")
|
require.Contains(t, msg.Attachment.URL, "http://127.0.0.1:12345/file/")
|
||||||
require.Equal(t, "", msg.Attachment.Owner) // Should never be returned
|
require.Equal(t, "", msg.Attachment.Owner) // Should never be returned
|
||||||
require.FileExists(t, filepath.Join(s.config.AttachmentCacheDir, msg.ID))
|
require.FileExists(t, filepath.Join(s.config.AttachmentCacheDir, msg.ID))
|
||||||
|
|
Loading…
Reference in a new issue