aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module_test.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-08-26 18:37:59 -0400
committerJulie Qiu <julie@golang.org>2020-08-28 14:00:05 +0000
commitdb8f07c3a29d8acc73cef9d7fa723b58ad5a9716 (patch)
tree922bd6e1bebadb09bb36663d7e8e9715ee09b23c /internal/postgres/insert_module_test.go
parentddad9a97c49dd68aa54ea3ff34e331f951d7c6a3 (diff)
downloadgo-x-pkgsite-db8f07c3a29d8acc73cef9d7fa723b58ad5a9716.tar.xz
internal/postgres: use FieldSet in GetDirectory
GetDirectory now supports the WithDocumentation, WithReadme, and AllFields fieldsets. At the moment, only one fieldset can be specified at a time. Additional support will be updated in future CLs. For golang/go#39629 Change-Id: I42b15d2d06a0b36aa0298a79ea1c06303b682926 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/250946 Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
-rw-r--r--internal/postgres/insert_module_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go
index 4ce028b6..e8b39ab1 100644
--- a/internal/postgres/insert_module_test.go
+++ b/internal/postgres/insert_module_test.go
@@ -111,7 +111,7 @@ func checkModule(ctx context.Context, t *testing.T, want *internal.Module) {
}
for _, dir := range want.Directories {
- got, err := testDB.getDirectory(ctx, dir.Path, want.ModulePath, want.Version)
+ got, err := testDB.GetDirectory(ctx, dir.Path, want.ModulePath, want.Version, 0, internal.AllFields)
if err != nil {
t.Fatal(err)
}
@@ -185,7 +185,7 @@ func TestInsertModuleLicenseCheck(t *testing.T) {
checkHasRedistData(mi.LegacyReadmeContents, pkg.DocumentationHTML, bypass)
// New model
- dir, err := db.getDirectory(ctx, mod.ModulePath, mod.ModulePath, mod.Version)
+ dir, err := db.GetDirectory(ctx, mod.ModulePath, mod.ModulePath, mod.Version, 0, internal.AllFields)
if err != nil {
t.Fatal(err)
}