mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-23 14:30:26 +02:00
updated filesystem tests
This commit is contained in:
1 parent
2c961da382
commit
3d8f401a0d
2 files changed
+7
-7
No files matched your search
@@ -64,8 +64,8 @@ func TestNewFileFromPath(t *testing.T) {
|
||||
if match, err := regexp.Match(normalizedNamePattern, []byte(f.Name)); !match {
|
||||
t.Fatalf("Expected Name to match %v, got %q (%v)", normalizedNamePattern, f.Name, err)
|
||||
}
|
||||
if f.Size != 77 {
|
||||
t.Fatalf("Expected Size %v, got %v", 77, f.Size)
|
||||
if f.Size != 78 {
|
||||
t.Fatalf("Expected Size %v, got %v", 78, f.Size)
|
||||
}
|
||||
if _, ok := f.Reader.(*filesystem.PathReader); !ok {
|
||||
t.Fatalf("Expected Reader to be PathReader, got %v", f.Reader)
|
||||
|
||||
@@ -487,7 +487,7 @@ func TestFilesystemServe(t *testing.T) {
|
||||
map[string]string{
|
||||
"Content-Disposition": `inline; filename="test_name.png"`,
|
||||
"Content-Type": "image/png",
|
||||
"Content-Length": "77",
|
||||
"Content-Length": "78",
|
||||
"Content-Security-Policy": csp,
|
||||
"Cache-Control": cacheControl,
|
||||
},
|
||||
@@ -502,7 +502,7 @@ func TestFilesystemServe(t *testing.T) {
|
||||
map[string]string{
|
||||
"Content-Disposition": `attachment; filename="test_name_download.png"`,
|
||||
"Content-Type": "image/png",
|
||||
"Content-Length": "77",
|
||||
"Content-Length": "78",
|
||||
"Content-Security-Policy": csp,
|
||||
"Cache-Control": cacheControl,
|
||||
},
|
||||
@@ -847,8 +847,8 @@ func TestFilesystemCopy(t *testing.T) {
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
if f.Size() != 77 {
|
||||
t.Fatalf("Expected file size %d, got %d", 77, f.Size())
|
||||
if f.Size() != 78 {
|
||||
t.Fatalf("Expected file size %d, got %d", 78, f.Size())
|
||||
}
|
||||
|
||||
checkHooks(t, hookCalls, map[string]int{"OnDelete": 0, "OnNewWriter": 0})
|
||||
@@ -958,7 +958,7 @@ func TestFilesystemServeSingleRange(t *testing.T) {
|
||||
t.Fatalf("Expected StatusCode %d, got %d", http.StatusPartialContent, result.StatusCode)
|
||||
}
|
||||
|
||||
expectedRange := "bytes 0-20/77"
|
||||
expectedRange := "bytes 0-20/78"
|
||||
if cr := result.Header.Get("Content-Range"); cr != expectedRange {
|
||||
t.Fatalf("Expected Content-Range %q, got %q", expectedRange, cr)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user