55 "errors"
66 "net/http"
77 "testing"
8+ "time"
89
910 "github.com/docker/docker/api/types/container"
1011 "github.com/h2non/gock"
@@ -48,7 +49,7 @@ func TestGenLocalCommand(t *testing.T) {
4849 conn := pgtest .NewConn ()
4950 defer conn .Close (t )
5051 // Run test
51- assert .NoError (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , fsys , conn .Intercept ))
52+ assert .NoError (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , time . Second , fsys , conn .Intercept ))
5253 // Validate api
5354 assert .Empty (t , apitest .ListUnmatchedRequests ())
5455 })
@@ -63,7 +64,7 @@ func TestGenLocalCommand(t *testing.T) {
6364 Get ("/v" + utils .Docker .ClientVersion () + "/containers/" + utils .DbId ).
6465 Reply (http .StatusServiceUnavailable )
6566 // Run test
66- assert .Error (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , fsys ))
67+ assert .Error (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , time . Second , fsys ))
6768 // Validate api
6869 assert .Empty (t , apitest .ListUnmatchedRequests ())
6970 })
@@ -83,7 +84,7 @@ func TestGenLocalCommand(t *testing.T) {
8384 Get ("/v" + utils .Docker .ClientVersion () + "/images" ).
8485 Reply (http .StatusServiceUnavailable )
8586 // Run test
86- assert .Error (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , fsys ))
87+ assert .Error (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {}, true , "" , time . Second , fsys ))
8788 // Validate api
8889 assert .Empty (t , apitest .ListUnmatchedRequests ())
8990 })
@@ -106,7 +107,7 @@ func TestGenLocalCommand(t *testing.T) {
106107 conn := pgtest .NewConn ()
107108 defer conn .Close (t )
108109 // Run test
109- assert .NoError (t , Run (context .Background (), "" , dbConfig , LangSwift , []string {}, true , SwiftInternalAccessControl , fsys , conn .Intercept ))
110+ assert .NoError (t , Run (context .Background (), "" , dbConfig , LangSwift , []string {}, true , SwiftInternalAccessControl , time . Second , fsys , conn .Intercept ))
110111 // Validate api
111112 assert .Empty (t , apitest .ListUnmatchedRequests ())
112113 })
@@ -129,7 +130,7 @@ func TestGenLinkedCommand(t *testing.T) {
129130 Reply (200 ).
130131 JSON (api.TypescriptResponse {Types : "" })
131132 // Run test
132- assert .NoError (t , Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , fsys ))
133+ assert .NoError (t , Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , time . Second , fsys ))
133134 // Validate api
134135 assert .Empty (t , apitest .ListUnmatchedRequests ())
135136 })
@@ -144,7 +145,7 @@ func TestGenLinkedCommand(t *testing.T) {
144145 Get ("/v1/projects/" + projectId + "/types/typescript" ).
145146 ReplyError (errNetwork )
146147 // Run test
147- err := Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , fsys )
148+ err := Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , time . Second , fsys )
148149 // Validate api
149150 assert .ErrorIs (t , err , errNetwork )
150151 assert .Empty (t , apitest .ListUnmatchedRequests ())
@@ -159,7 +160,7 @@ func TestGenLinkedCommand(t *testing.T) {
159160 Get ("/v1/projects/" + projectId + "/types/typescript" ).
160161 Reply (http .StatusServiceUnavailable )
161162 // Run test
162- assert .Error (t , Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , fsys ))
163+ assert .Error (t , Run (context .Background (), projectId , pgconn.Config {}, LangTypescript , []string {}, true , "" , time . Second , fsys ))
163164 })
164165}
165166
@@ -184,7 +185,7 @@ func TestGenRemoteCommand(t *testing.T) {
184185 conn := pgtest .NewConn ()
185186 defer conn .Close (t )
186187 // Run test
187- assert .NoError (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {"public" }, true , "" , afero .NewMemMapFs (), conn .Intercept ))
188+ assert .NoError (t , Run (context .Background (), "" , dbConfig , LangTypescript , []string {"public" }, true , "" , time . Second , afero .NewMemMapFs (), conn .Intercept ))
188189 // Validate api
189190 assert .Empty (t , apitest .ListUnmatchedRequests ())
190191 })
0 commit comments