diff options
| author | Julie Qiu <julie@golang.org> | 2020-09-29 17:06:12 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-09-30 13:33:49 +0000 |
| commit | 733b0d70aa885afae848ff2b0aa892ec810a0a8a (patch) | |
| tree | 62cca4e0deb4a82c04b56cc9b0989c756f3b1ed6 /internal/postgres/insert_module_test.go | |
| parent | 35487d7eaf74558ae638c9f7dff95aab8222b735 (diff) | |
| download | go-x-pkgsite-733b0d70aa885afae848ff2b0aa892ec810a0a8a.tar.xz | |
internal/postgres: delete LegacyGetModuleInfo
For golang/go#39629
Change-Id: I3be1a9ce361d73e0d6f7b373ac7c410bc571481b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258290
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
| -rw-r--r-- | internal/postgres/insert_module_test.go | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go index 6dcde6a6..cd64eaa7 100644 --- a/internal/postgres/insert_module_test.go +++ b/internal/postgres/insert_module_test.go @@ -85,12 +85,12 @@ func TestInsertModule(t *testing.T) { } func checkModule(ctx context.Context, t *testing.T, want *internal.Module) { - got, err := testDB.LegacyGetModuleInfo(ctx, want.ModulePath, want.Version) + got, err := testDB.GetModuleInfo(ctx, want.ModulePath, want.Version) if err != nil { t.Fatal(err) } - if diff := cmp.Diff(want.LegacyModuleInfo, *got, cmp.AllowUnexported(source.Info{})); diff != "" { - t.Fatalf("testDB.LegacyGetModuleInfo(%q, %q) mismatch (-want +got):\n%s", want.ModulePath, want.Version, diff) + if diff := cmp.Diff(want.ModuleInfo, *got, cmp.AllowUnexported(source.Info{})); diff != "" { + t.Fatalf("testDB.GetModuleInfo(%q, %q) mismatch (-want +got):\n%s", want.ModulePath, want.Version, diff) } for _, wantp := range want.LegacyPackages { @@ -177,17 +177,6 @@ func TestInsertModuleLicenseCheck(t *testing.T) { t.Fatal(err) } - // Legacy model - mi, err := db.LegacyGetModuleInfo(ctx, mod.ModulePath, mod.Version) - if err != nil { - t.Fatal(err) - } - pkg, err := db.LegacyGetPackage(ctx, mod.ModulePath, mod.ModulePath, mod.Version) - if err != nil { - t.Fatal(err) - } - checkHasRedistData(mi.LegacyReadmeContents, pkg.DocumentationHTML, bypass) - // New model pathInfo := &internal.UnitMeta{ Path: mod.ModulePath, @@ -436,7 +425,7 @@ func TestDeleteModule(t *testing.T) { if err := testDB.InsertModule(ctx, v); err != nil { t.Fatal(err) } - if _, err := testDB.LegacyGetModuleInfo(ctx, v.ModulePath, v.Version); err != nil { + if _, err := testDB.GetModuleInfo(ctx, v.ModulePath, v.Version); err != nil { t.Fatal(err) } @@ -451,7 +440,7 @@ func TestDeleteModule(t *testing.T) { if err := testDB.DeleteModule(ctx, v.ModulePath, v.Version); err != nil { t.Fatal(err) } - if _, err := testDB.LegacyGetModuleInfo(ctx, v.ModulePath, v.Version); !errors.Is(err, derrors.NotFound) { + if _, err := testDB.GetModuleInfo(ctx, v.ModulePath, v.Version); !errors.Is(err, derrors.NotFound) { t.Errorf("got %v, want NotFound", err) } |
