@@ -20,16 +20,13 @@ import (
2020 "github.com/google/go-cmp/cmp"
2121 "github.com/google/go-cmp/cmp/cmpopts"
2222 "github.com/googleapis/librarian/internal/sidekick/api"
23- "github.com/googleapis/librarian/internal/sidekick/config"
2423)
2524
2625func TestDisco_Parse (t * testing.T ) {
27- cfg := & config.Config {
28- General : config.GeneralConfig {
29- // Mixing Compute and Secret Manager like this is fine in tests.
30- SpecificationSource : discoSourceFile ,
31- ServiceConfig : secretManagerYamlFullPath ,
32- },
26+ cfg := ModelConfig {
27+ // Mixing Compute and Secret Manager like this is fine in tests.
28+ SpecificationSource : discoSourceFile ,
29+ ServiceConfig : secretManagerYamlFullPath ,
3330 }
3431 got , err := ParseDisco (cfg )
3532 if err != nil {
@@ -54,10 +51,8 @@ func TestDisco_Parse(t *testing.T) {
5451}
5552
5653func TestDisco_FindSources (t * testing.T ) {
57- cfg := & config.Config {
58- General : config.GeneralConfig {
59- SpecificationSource : discoSourceFileRelative ,
60- },
54+ cfg := ModelConfig {
55+ SpecificationSource : discoSourceFileRelative ,
6156 Source : map [string ]string {
6257 "test-root" : mainTestdataDir ,
6358 "roots" : "undefined,test" ,
@@ -83,10 +78,8 @@ func TestDisco_FindSources(t *testing.T) {
8378}
8479
8580func TestDisco_ParseNoServiceConfig (t * testing.T ) {
86- cfg := & config.Config {
87- General : config.GeneralConfig {
88- SpecificationSource : discoSourceFile ,
89- },
81+ cfg := ModelConfig {
82+ SpecificationSource : discoSourceFile ,
9083 }
9184 got , err := ParseDisco (cfg )
9285 if err != nil {
@@ -107,10 +100,8 @@ func TestDisco_ParseNoServiceConfig(t *testing.T) {
107100}
108101
109102func TestDisco_ParsePagination (t * testing.T ) {
110- cfg := & config.Config {
111- General : config.GeneralConfig {
112- SpecificationSource : discoSourceFile ,
113- },
103+ cfg := ModelConfig {
104+ SpecificationSource : discoSourceFile ,
114105 }
115106 model , err := ParseDisco (cfg )
116107 if err != nil {
@@ -136,10 +127,8 @@ func TestDisco_ParsePagination(t *testing.T) {
136127}
137128
138129func TestDisco_ParsePaginationAggregate (t * testing.T ) {
139- cfg := & config.Config {
140- General : config.GeneralConfig {
141- SpecificationSource : discoSourceFile ,
142- },
130+ cfg := ModelConfig {
131+ SpecificationSource : discoSourceFile ,
143132 }
144133 model , err := ParseDisco (cfg )
145134 if err != nil {
@@ -165,10 +154,8 @@ func TestDisco_ParsePaginationAggregate(t *testing.T) {
165154}
166155
167156func TestDisco_ParseDeprecatedEnum (t * testing.T ) {
168- cfg := & config.Config {
169- General : config.GeneralConfig {
170- SpecificationSource : discoSourceFile ,
171- },
157+ cfg := ModelConfig {
158+ SpecificationSource : discoSourceFile ,
172159 }
173160 model , err := ParseDisco (cfg )
174161 if err != nil {
@@ -190,12 +177,12 @@ func TestDisco_ParseDeprecatedEnum(t *testing.T) {
190177}
191178
192179func TestDisco_ParseBadFiles (t * testing.T ) {
193- for _ , cfg := range []config. GeneralConfig {
180+ for _ , cfg := range []ModelConfig {
194181 {SpecificationSource : "-invalid-file-name-" , ServiceConfig : secretManagerYamlFullPath },
195182 {SpecificationSource : discoSourceFile , ServiceConfig : "-invalid-file-name-" },
196183 {SpecificationSource : secretManagerYamlFullPath , ServiceConfig : secretManagerYamlFullPath },
197184 } {
198- if got , err := ParseDisco (& config. Config { General : cfg } ); err == nil {
185+ if got , err := ParseDisco (cfg ); err == nil {
199186 t .Fatalf ("expected error with missing source file, got=%v" , got )
200187 }
201188 }
0 commit comments