mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-08-13 14:27:27 +00:00
test(files): isolate over-quota test from seeded-README baseline
TestWebSaveOverQuotaPreservesExistingFile set quota=5 but left sess.used
at the newSession baseline, which already counts the README.txt that
ensureUserPub seeds into /public (added in d19c5c4). That baseline alone
exceeds 5 bytes, so the initial 2-byte save was rejected with
'quota exceeded' before the test could exercise the over-quota replace.
Reset sess.used to 0 after setting the tiny quota, mirroring
TestQuotaEnforced, so the writer starts from a clean gauge.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
9f02e0faf2
commit
9af7857c98
1 changed files with 1 additions and 0 deletions
|
|
@ -173,6 +173,7 @@ func TestWebSaveOverQuotaPreservesExistingFile(t *testing.T) {
|
|||
svc, _, u := newTestService(t)
|
||||
sess, _ := svc.newSession(u)
|
||||
sess.quota = 5
|
||||
sess.used.Store(0) // isolate the writer from the seeded-README baseline
|
||||
|
||||
if _, err := sess.webSave("/me/note.txt", strings.NewReader("ok")); err != nil {
|
||||
t.Fatalf("initial save failed: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue