mirror of
https://github.com/kopia/kopia.git
synced 2026-09-08 11:26:03 -04:00
test(repository): server testability refactoring (#2612)
- removed repo.OpenAPIServer() which was only needed for testability - introduced servertesting package to replace it
This commit is contained in:
1 parent
fa5aaa40ac
commit
e57020fb70
24 files changed
+217
-228
No files matched your search
@@ -359,9 +359,7 @@ func verifyFull(ctx context.Context, t *testing.T, om *Manager, oid ID, want []b
|
||||
func verifyNoError(t *testing.T, err error) {
|
||||
t.Helper()
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func verifyIndirectBlock(ctx context.Context, t *testing.T, om *Manager, oid ID) {
|
||||
@@ -598,14 +596,10 @@ func mustWriteObject(t *testing.T, om *Manager, data []byte, compressor compress
|
||||
defer w.Close()
|
||||
|
||||
_, err := w.Write(data)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
oid, err := w.Result()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
return oid
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user