|
|
|
internal/configport/file_limits_test.go raw
| 1 | package configport | | 2 | | | 3 | import ( | | 4 | "testing" | | 5 | | | 6 | "github.com/FelineStateMachine/tinyrelay/internal/policy" | | 7 | ) | | 8 | | | 9 | func TestImportFileLimits(t *testing.T) { | | 10 | doc, err := Parse([]byte(`{"format":"bind.ws/relay-config/2","policy":{"fileLimits":{"maxFileBytes":1024,"userStorageBytes":4096}}}` )) | | 11 | if err != nil { | | 12 | t.Fatal(err) | | 13 | } | | 14 | if len(doc.Warnings) != 0 { | | 15 | t.Fatalf("file limits should be portable: %v" , doc.Warnings) | | 16 | } | | 17 | got, err := finalPolicy(policy.Defaults("owner" ), doc, "" ) | | 18 | if err != nil { | | 19 | t.Fatal(err) | | 20 | } | | 21 | if got.FileLimits.MaxFileBytes != 1024 || got.FileLimits.UserStorageBytes != 4096 { | | 22 | t.Fatalf("file limits lost during import: %+v" , got.FileLimits) | | 23 | } | | 24 | } |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|