@@ -102,7 +102,7 @@ func TestFetchAndUpdateState_NotFound(t *testing.T) {
102
102
// Verify that the module status is recorded correctly, and that the version is in the DB.
103
103
checkStatus (http .StatusOK )
104
104
105
- if _ , err := testDB .LegacyGetModuleInfo (ctx , modulePath , version ); err != nil {
105
+ if _ , err := testDB .GetModuleInfo (ctx , modulePath , version ); err != nil {
106
106
t .Fatal (err )
107
107
}
108
108
@@ -151,8 +151,8 @@ func TestFetchAndUpdateState_NotFound(t *testing.T) {
151
151
// - It shouldn't be in the modules table. That also covers licenses, packages and paths tables
152
152
// via foreign key constraints with ON DELETE CASCADE.
153
153
// - It shouldn't be in other tables like search_documents and the various imports tables.
154
- if _ , err := testDB .LegacyGetModuleInfo (ctx , modulePath , version ); ! errors .Is (err , derrors .NotFound ) {
155
- t .Fatalf ("LegacyGetModuleInfo : got %v, want NotFound" , err )
154
+ if _ , err := testDB .GetModuleInfo (ctx , modulePath , version ); ! errors .Is (err , derrors .NotFound ) {
155
+ t .Fatalf ("GetModuleInfo : got %v, want NotFound" , err )
156
156
}
157
157
158
158
checkNotInTable := func (table , column string ) {
@@ -197,7 +197,7 @@ func checkModuleNotFound(t *testing.T, ctx context.Context, modulePath, version
197
197
if code != wantCode || ! errors .Is (err , wantErr ) {
198
198
t .Fatalf ("got %d, %v; want %d, Is(err, %v)" , code , err , wantCode , wantErr )
199
199
}
200
- _ , err = testDB .LegacyGetModuleInfo (ctx , modulePath , version )
200
+ _ , err = testDB .GetModuleInfo (ctx , modulePath , version )
201
201
if ! errors .Is (err , derrors .NotFound ) {
202
202
t .Fatalf ("got %v, want Is(NotFound)" , err )
203
203
}
@@ -342,7 +342,7 @@ func TestFetchAndUpdateState_Mismatch(t *testing.T) {
342
342
if code != wantCode || ! errors .Is (err , wantErr ) {
343
343
t .Fatalf ("got %d, %v; want %d, Is(err, derrors.AlternativeModule)" , code , err , wantCode )
344
344
}
345
- _ , err = testDB .LegacyGetModuleInfo (ctx , modulePath , version )
345
+ _ , err = testDB .GetModuleInfo (ctx , modulePath , version )
346
346
if ! errors .Is (err , derrors .NotFound ) {
347
347
t .Fatalf ("got %v, want Is(NotFound)" , err )
348
348
}
@@ -1052,12 +1052,12 @@ func TestFetchAndInsertModule(t *testing.T) {
1052
1052
t .Fatalf ("FetchAndUpdateState(%q, %q, %v, %v, %v): %v" , test .modulePath , test .version , proxyClient , sourceClient , testDB , err )
1053
1053
}
1054
1054
1055
- gotModuleInfo , err := testDB .LegacyGetModuleInfo (ctx , test .modulePath , test .version )
1055
+ gotModuleInfo , err := testDB .GetModuleInfo (ctx , test .modulePath , test .want . Version )
1056
1056
if err != nil {
1057
1057
t .Fatal (err )
1058
1058
}
1059
- if diff := cmp .Diff (test .want .LegacyModuleInfo , * gotModuleInfo , cmp .AllowUnexported (source.Info {})); diff != "" {
1060
- t .Fatalf ("testDB.LegacyGetModuleInfo (ctx, %q, %q) mismatch (-want +got):\n %s" , test .modulePath , test .version , diff )
1059
+ if diff := cmp .Diff (test .want .ModuleInfo , * gotModuleInfo , cmp .AllowUnexported (source.Info {})); diff != "" {
1060
+ t .Fatalf ("testDB.GetModuleInfo (ctx, %q, %q) mismatch (-want +got):\n %s" , test .modulePath , test .version , diff )
1061
1061
}
1062
1062
1063
1063
gotPkg , err := testDB .LegacyGetPackage (ctx , test .pkg , internal .UnknownModulePath , test .version )
0 commit comments