(t *testing.T, ctx context.Context, s *LFSStore)
| 45 | } |
| 46 | |
| 47 | func lfsCreateObject(t *testing.T, ctx context.Context, s *LFSStore) { |
| 48 | // Create first LFS object |
| 49 | repoID := int64(1) |
| 50 | oid := lfsutil.OID("ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f") |
| 51 | err := s.CreateObject(ctx, repoID, oid, 12, lfsutil.StorageLocal) |
| 52 | require.NoError(t, err) |
| 53 | |
| 54 | // Get it back and check the CreatedAt field |
| 55 | object, err := s.GetObjectByOID(ctx, repoID, oid) |
| 56 | require.NoError(t, err) |
| 57 | assert.Equal(t, s.db.NowFunc().Format(time.RFC3339), object.CreatedAt.UTC().Format(time.RFC3339)) |
| 58 | |
| 59 | // Try to create second LFS object with same oid should fail |
| 60 | err = s.CreateObject(ctx, repoID, oid, 12, lfsutil.StorageLocal) |
| 61 | assert.Error(t, err) |
| 62 | } |
| 63 | |
| 64 | func lfsGetObjectByOID(t *testing.T, ctx context.Context, s *LFSStore) { |
| 65 | // Create a LFS object |
nothing calls this directly
no test coverage detected