mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-26 15:00:26 +01:00
abstract rest.UploadedFile to allow loading local files
This commit is contained in:
1 parent
aa6eaa7319
commit
37bac5cc50
12 files changed
+322
-114
No files matched your search
@@ -47,16 +47,16 @@ func TestFindUploadedFiles(t *testing.T) {
|
||||
t.Errorf("[%d] Expected 1 file, got %d", i, len(result))
|
||||
}
|
||||
|
||||
if result[0].Header().Size != 4 {
|
||||
t.Errorf("[%d] Expected the file size to be 4 bytes, got %d", i, result[0].Header().Size)
|
||||
if result[0].Size != 4 {
|
||||
t.Errorf("[%d] Expected the file size to be 4 bytes, got %d", i, result[0].Size)
|
||||
}
|
||||
|
||||
pattern, err := regexp.Compile(s.expectedPattern)
|
||||
if err != nil {
|
||||
t.Errorf("[%d] Invalid filename pattern %q: %v", i, s.expectedPattern, err)
|
||||
}
|
||||
if !pattern.MatchString(result[0].Name()) {
|
||||
t.Fatalf("Expected filename to match %s, got filename %s", s.expectedPattern, result[0].Name())
|
||||
if !pattern.MatchString(result[0].Name) {
|
||||
t.Fatalf("Expected filename to match %s, got filename %s", s.expectedPattern, result[0].Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user