Skip to content

Commit 92a9d91

Browse files
committed
more test edits
1 parent f75eefc commit 92a9d91

12 files changed

Lines changed: 69 additions & 68 deletions

server/gql/agency_resolver_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ func TestAgencyResolver_License(t *testing.T) {
428428
query: q,
429429
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
430430
selector: "agencies.#.feed_version.feed.onestop_id",
431-
selectExpectUnique: []string{"BA"},
432-
selectExpectCount: 1,
431+
selectExpectUnique: []string{"hopelink-flex", "BA"},
432+
selectExpectCount: 2,
433433
},
434434
{
435435
name: "license filter: share_alike_optional = exclude_no",
@@ -453,8 +453,8 @@ func TestAgencyResolver_License(t *testing.T) {
453453
query: q,
454454
vars: hw{"lic": hw{"create_derived_product": "NO"}},
455455
selector: "agencies.#.feed_version.feed.onestop_id",
456-
selectExpectUnique: []string{"BA"},
457-
selectExpectCount: 1,
456+
selectExpectUnique: []string{"hopelink-flex", "BA"},
457+
selectExpectCount: 2,
458458
},
459459
{
460460
name: "license filter: create_derived_product = exclude_no",
@@ -478,8 +478,8 @@ func TestAgencyResolver_License(t *testing.T) {
478478
query: q,
479479
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
480480
selector: "agencies.#.feed_version.feed.onestop_id",
481-
selectExpectUnique: []string{"BA"},
482-
selectExpectCount: 1,
481+
selectExpectUnique: []string{"hopelink-flex", "BA"},
482+
selectExpectCount: 2,
483483
},
484484
{
485485
name: "license filter: commercial_use_allowed = exclude_no",
@@ -503,8 +503,8 @@ func TestAgencyResolver_License(t *testing.T) {
503503
query: q,
504504
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
505505
selector: "agencies.#.feed_version.feed.onestop_id",
506-
selectExpectUnique: []string{"BA"},
507-
selectExpectCount: 1,
506+
selectExpectUnique: []string{"hopelink-flex", "BA"},
507+
selectExpectCount: 2,
508508
},
509509
{
510510
name: "license filter: redistribution_allowed = exclude_no",
@@ -528,8 +528,8 @@ func TestAgencyResolver_License(t *testing.T) {
528528
query: q,
529529
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
530530
selector: "agencies.#.feed_version.feed.onestop_id",
531-
selectExpectUnique: []string{"BA"},
532-
selectExpectCount: 1,
531+
selectExpectUnique: []string{"hopelink-flex", "BA"},
532+
selectExpectCount: 2,
533533
},
534534
{
535535
name: "license filter: use_without_attribution = exclude_no",

server/gql/feed_resolver_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func TestFeedResolver_License(t *testing.T) {
299299
query: q,
300300
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
301301
selector: "feeds.#.onestop_id",
302-
selectExpect: []string{"BA"},
302+
selectExpect: []string{"hopelink-flex", "BA"},
303303
},
304304
{
305305
name: "license filter: share_alike_optional = unknown",
@@ -328,7 +328,7 @@ func TestFeedResolver_License(t *testing.T) {
328328
query: q,
329329
vars: hw{"lic": hw{"create_derived_product": "NO"}},
330330
selector: "feeds.#.onestop_id",
331-
selectExpect: []string{"BA"},
331+
selectExpect: []string{"hopelink-flex", "BA"},
332332
},
333333
{
334334
name: "license filter: create_derived_product = unknown",
@@ -357,7 +357,7 @@ func TestFeedResolver_License(t *testing.T) {
357357
query: q,
358358
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
359359
selector: "feeds.#.onestop_id",
360-
selectExpect: []string{"BA"},
360+
selectExpect: []string{"hopelink-flex", "BA"},
361361
},
362362
{
363363
name: "license filter: commercial_use_allowed = unknown",
@@ -386,7 +386,7 @@ func TestFeedResolver_License(t *testing.T) {
386386
query: q,
387387
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
388388
selector: "feeds.#.onestop_id",
389-
selectExpect: []string{"BA"},
389+
selectExpect: []string{"hopelink-flex", "BA"},
390390
},
391391
{
392392
name: "license filter: redistribution_allowed = unknown",
@@ -416,7 +416,7 @@ func TestFeedResolver_License(t *testing.T) {
416416
query: q,
417417
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
418418
selector: "feeds.#.onestop_id",
419-
selectExpect: []string{"BA"},
419+
selectExpect: []string{"hopelink-flex", "BA"},
420420
},
421421
{
422422
name: "license filter: use_without_attribution = unknown",

server/gql/feed_version_resolver_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ func TestFeedVersionResolver_BookingRules(t *testing.T) {
566566
func TestFeedVersionResolver_License(t *testing.T) {
567567
q := `query($lic:LicenseFilter) {feed_versions(where: {license: $lic}) {sha1 feed { onestop_id} }}`
568568
baFvs := []string{"e535eb2b3b9ac3ef15d82c56575e914575e732e0", "dd7aca4a8e4c90908fd3603c097fabee75fea907", "96b67c0934b689d9085c52967365d8c233ea321d"}
569+
restrictiveNoFvs := []string{"40b1560b9767ca4ee5d9cc3f70947822e0e346be", "e535eb2b3b9ac3ef15d82c56575e914575e732e0", "dd7aca4a8e4c90908fd3603c097fabee75fea907", "96b67c0934b689d9085c52967365d8c233ea321d"}
569570
haFvs := []string{"c969427f56d3a645195dd8365cde6d7feae7e99b"}
570571
ctFvs := []string{"d2813c293bcfd7a97dde599527ae6c62c98e66c6"}
571572
HaCtExFvs := []string{"43e2278aa272879c79460582152b04e7487f0493", "c969427f56d3a645195dd8365cde6d7feae7e99b", "d2813c293bcfd7a97dde599527ae6c62c98e66c6", "e8bc76c3c8602cad745f41a49ed5c5627ad6904c"}
@@ -583,7 +584,7 @@ func TestFeedVersionResolver_License(t *testing.T) {
583584
query: q,
584585
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
585586
selector: "feed_versions.#.sha1",
586-
selectExpect: baFvs,
587+
selectExpect: restrictiveNoFvs,
587588
},
588589
{
589590
name: "license filter: share_alike_optional = unknown",
@@ -612,7 +613,7 @@ func TestFeedVersionResolver_License(t *testing.T) {
612613
query: q,
613614
vars: hw{"lic": hw{"create_derived_product": "NO"}},
614615
selector: "feed_versions.#.sha1",
615-
selectExpect: baFvs,
616+
selectExpect: restrictiveNoFvs,
616617
},
617618
{
618619
name: "license filter: create_derived_product = unknown",
@@ -641,7 +642,7 @@ func TestFeedVersionResolver_License(t *testing.T) {
641642
query: q,
642643
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
643644
selector: "feed_versions.#.sha1",
644-
selectExpect: baFvs,
645+
selectExpect: restrictiveNoFvs,
645646
},
646647
{
647648
name: "license filter: commercial_use_allowed = unknown",
@@ -670,7 +671,7 @@ func TestFeedVersionResolver_License(t *testing.T) {
670671
query: q,
671672
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
672673
selector: "feed_versions.#.sha1",
673-
selectExpect: baFvs,
674+
selectExpect: restrictiveNoFvs,
674675
},
675676
{
676677
name: "license filter: redistribution_allowed = unknown",
@@ -700,7 +701,7 @@ func TestFeedVersionResolver_License(t *testing.T) {
700701
query: q,
701702
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
702703
selector: "feed_versions.#.sha1",
703-
selectExpect: baFvs,
704+
selectExpect: restrictiveNoFvs,
704705
},
705706
{
706707
name: "license filter: use_without_attribution = unknown",

server/gql/route_resolver_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ func TestRouteResolver_License(t *testing.T) {
628628
query: q,
629629
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
630630
selector: "routes.#.feed_version.feed.onestop_id",
631-
selectExpectUnique: []string{"BA"},
632-
selectExpectCount: 6,
631+
selectExpectUnique: []string{"hopelink-flex", "BA"},
632+
selectExpectCount: 7,
633633
},
634634
{
635635
name: "license filter: share_alike_optional = exclude_no",
@@ -653,8 +653,8 @@ func TestRouteResolver_License(t *testing.T) {
653653
query: q,
654654
vars: hw{"lic": hw{"create_derived_product": "NO"}},
655655
selector: "routes.#.feed_version.feed.onestop_id",
656-
selectExpectUnique: []string{"BA"},
657-
selectExpectCount: 6,
656+
selectExpectUnique: []string{"hopelink-flex", "BA"},
657+
selectExpectCount: 7,
658658
},
659659
{
660660
name: "license filter: create_derived_product = exclude_no",
@@ -678,8 +678,8 @@ func TestRouteResolver_License(t *testing.T) {
678678
query: q,
679679
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
680680
selector: "routes.#.feed_version.feed.onestop_id",
681-
selectExpectUnique: []string{"BA"},
682-
selectExpectCount: 6,
681+
selectExpectUnique: []string{"hopelink-flex", "BA"},
682+
selectExpectCount: 7,
683683
},
684684
{
685685
name: "license filter: commercial_use_allowed = exclude_no",
@@ -703,8 +703,8 @@ func TestRouteResolver_License(t *testing.T) {
703703
query: q,
704704
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
705705
selector: "routes.#.feed_version.feed.onestop_id",
706-
selectExpectUnique: []string{"BA"},
707-
selectExpectCount: 6,
706+
selectExpectUnique: []string{"hopelink-flex", "BA"},
707+
selectExpectCount: 7,
708708
},
709709
{
710710
name: "license filter: redistribution_allowed = exclude_no",
@@ -728,8 +728,8 @@ func TestRouteResolver_License(t *testing.T) {
728728
query: q,
729729
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
730730
selector: "routes.#.feed_version.feed.onestop_id",
731-
selectExpectUnique: []string{"BA"},
732-
selectExpectCount: 6,
731+
selectExpectUnique: []string{"hopelink-flex", "BA"},
732+
selectExpectCount: 7,
733733
},
734734
{
735735
name: "license filter: use_without_attribution = exclude_no",

server/gql/stop_resolver_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,8 @@ func stopResolverLicenseTestcases(t testing.TB, cfg model.Config) []testcase {
983983
query: q,
984984
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
985985
selector: "stops.#.feed_version.feed.onestop_id",
986-
selectExpectUnique: []string{"BA"},
987-
selectExpectCount: 50,
986+
selectExpectUnique: []string{"hopelink-flex", "BA"},
987+
selectExpectCount: 52,
988988
},
989989
{
990990
name: "license filter: share_alike_optional = exclude_no",
@@ -1008,8 +1008,8 @@ func stopResolverLicenseTestcases(t testing.TB, cfg model.Config) []testcase {
10081008
query: q,
10091009
vars: hw{"lic": hw{"create_derived_product": "NO"}},
10101010
selector: "stops.#.feed_version.feed.onestop_id",
1011-
selectExpectUnique: []string{"BA"},
1012-
selectExpectCount: 50,
1011+
selectExpectUnique: []string{"hopelink-flex", "BA"},
1012+
selectExpectCount: 52,
10131013
},
10141014
{
10151015
name: "license filter: create_derived_product = exclude_no",
@@ -1033,8 +1033,8 @@ func stopResolverLicenseTestcases(t testing.TB, cfg model.Config) []testcase {
10331033
query: q,
10341034
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
10351035
selector: "stops.#.feed_version.feed.onestop_id",
1036-
selectExpectUnique: []string{"BA"},
1037-
selectExpectCount: 50,
1036+
selectExpectUnique: []string{"hopelink-flex", "BA"},
1037+
selectExpectCount: 52,
10381038
},
10391039
{
10401040
name: "license filter: commercial_use_allowed = exclude_no",
@@ -1058,8 +1058,8 @@ func stopResolverLicenseTestcases(t testing.TB, cfg model.Config) []testcase {
10581058
query: q,
10591059
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
10601060
selector: "stops.#.feed_version.feed.onestop_id",
1061-
selectExpectUnique: []string{"BA"},
1062-
selectExpectCount: 50,
1061+
selectExpectUnique: []string{"hopelink-flex", "BA"},
1062+
selectExpectCount: 52,
10631063
},
10641064
{
10651065
name: "license filter: redistribution_allowed = exclude_no",
@@ -1083,8 +1083,8 @@ func stopResolverLicenseTestcases(t testing.TB, cfg model.Config) []testcase {
10831083
query: q,
10841084
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
10851085
selector: "stops.#.feed_version.feed.onestop_id",
1086-
selectExpectUnique: []string{"BA"},
1087-
selectExpectCount: 50,
1086+
selectExpectUnique: []string{"hopelink-flex", "BA"},
1087+
selectExpectCount: 52,
10881088
},
10891089
{
10901090
name: "license filter: use_without_attribution = exclude_no",

server/gql/trip_resolver_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ func TestTripResolver_License(t *testing.T) {
214214
query: q,
215215
vars: hw{"lic": hw{"share_alike_optional": "NO"}},
216216
selector: "trips.#.feed_version.feed.onestop_id",
217-
selectExpectUnique: []string{"BA"},
218-
selectExpectCount: 2525,
217+
selectExpectUnique: []string{"hopelink-flex", "BA"},
218+
selectExpectCount: 2526,
219219
},
220220
{
221221
name: "license filter: share_alike_optional = exclude_no",
@@ -239,8 +239,8 @@ func TestTripResolver_License(t *testing.T) {
239239
query: q,
240240
vars: hw{"lic": hw{"create_derived_product": "NO"}},
241241
selector: "trips.#.feed_version.feed.onestop_id",
242-
selectExpectUnique: []string{"BA"},
243-
selectExpectCount: 2525,
242+
selectExpectUnique: []string{"hopelink-flex", "BA"},
243+
selectExpectCount: 2526,
244244
},
245245
{
246246
name: "license filter: create_derived_product = exclude_no",
@@ -264,8 +264,8 @@ func TestTripResolver_License(t *testing.T) {
264264
query: q,
265265
vars: hw{"lic": hw{"commercial_use_allowed": "NO"}},
266266
selector: "trips.#.feed_version.feed.onestop_id",
267-
selectExpectUnique: []string{"BA"},
268-
selectExpectCount: 2525,
267+
selectExpectUnique: []string{"hopelink-flex", "BA"},
268+
selectExpectCount: 2526,
269269
},
270270
{
271271
name: "license filter: commercial_use_allowed = exclude_no",
@@ -289,8 +289,8 @@ func TestTripResolver_License(t *testing.T) {
289289
query: q,
290290
vars: hw{"lic": hw{"redistribution_allowed": "NO"}},
291291
selector: "trips.#.feed_version.feed.onestop_id",
292-
selectExpectUnique: []string{"BA"},
293-
selectExpectCount: 2525,
292+
selectExpectUnique: []string{"hopelink-flex", "BA"},
293+
selectExpectCount: 2526,
294294
},
295295
{
296296
name: "license filter: redistribution_allowed = exclude_no",
@@ -314,8 +314,8 @@ func TestTripResolver_License(t *testing.T) {
314314
query: q,
315315
vars: hw{"lic": hw{"use_without_attribution": "NO"}},
316316
selector: "trips.#.feed_version.feed.onestop_id",
317-
selectExpectUnique: []string{"BA"},
318-
selectExpectCount: 2525,
317+
selectExpectUnique: []string{"hopelink-flex", "BA"},
318+
selectExpectCount: 2526,
319319
},
320320
{
321321
name: "license filter: use_without_attribution = exclude_no",

server/rest/agency_request_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func TestAgencyRequest_License(t *testing.T) {
255255
{
256256
name: "license:share_alike_optional no",
257257
h: AgencyRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseShareAlikeOptional: "no"}}, selector: "agencies.#.agency_id",
258-
expectSelect: []string{"BART"},
258+
expectSelect: []string{"4982", "BART"},
259259
},
260260
{
261261
name: "license:share_alike_optional exclude_no",
@@ -270,7 +270,7 @@ func TestAgencyRequest_License(t *testing.T) {
270270
{
271271
name: "license:commercial_use_allowed no",
272272
h: AgencyRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseCommercialUseAllowed: "no"}}, selector: "agencies.#.agency_id",
273-
expectSelect: []string{"BART"},
273+
expectSelect: []string{"4982", "BART"},
274274
},
275275
{
276276
name: "license:commercial_use_allowed exclude_no",
@@ -285,7 +285,7 @@ func TestAgencyRequest_License(t *testing.T) {
285285
{
286286
name: "license:create_derived_product no",
287287
h: AgencyRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseCreateDerivedProduct: "no"}}, selector: "agencies.#.agency_id",
288-
expectSelect: []string{"BART"},
288+
expectSelect: []string{"4982", "BART"},
289289
},
290290
{
291291
name: "license:create_derived_product exclude_no",

server/rest/feed_request_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func TestFeedRequest_License(t *testing.T) {
190190
{
191191
name: "license:share_alike_optional no",
192192
h: FeedRequest{LicenseFilter: LicenseFilter{LicenseShareAlikeOptional: "no"}}, selector: "feeds.#.onestop_id",
193-
expectSelect: []string{"BA"},
193+
expectSelect: []string{"hopelink-flex", "BA"},
194194
},
195195
{
196196
name: "license:share_alike_optional exclude_no",
@@ -205,7 +205,7 @@ func TestFeedRequest_License(t *testing.T) {
205205
{
206206
name: "license:commercial_use_allowed no",
207207
h: FeedRequest{LicenseFilter: LicenseFilter{LicenseCommercialUseAllowed: "no"}}, selector: "feeds.#.onestop_id",
208-
expectSelect: []string{"BA"},
208+
expectSelect: []string{"hopelink-flex", "BA"},
209209
},
210210
{
211211
name: "license:commercial_use_allowed exclude_no",
@@ -220,7 +220,7 @@ func TestFeedRequest_License(t *testing.T) {
220220
{
221221
name: "license:create_derived_product no",
222222
h: FeedRequest{LicenseFilter: LicenseFilter{LicenseCreateDerivedProduct: "no"}}, selector: "feeds.#.onestop_id",
223-
expectSelect: []string{"BA"},
223+
expectSelect: []string{"hopelink-flex", "BA"},
224224
},
225225
{
226226
name: "license:create_derived_product exclude_no",

server/rest/operator_request_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func TestOperatorRequest_License(t *testing.T) {
175175
name: "license:share_alike_optional no",
176176
h: OperatorRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseShareAlikeOptional: "no"}},
177177
selector: "operators.#.onestop_id",
178-
expectSelect: []string{"o-9q9-bayarearapidtransit"},
178+
expectSelect: []string{"o-unknown-hopelinktransportation", "o-9q9-bayarearapidtransit"},
179179
},
180180
{
181181
name: "license:share_alike_optional exclude_no",
@@ -193,7 +193,7 @@ func TestOperatorRequest_License(t *testing.T) {
193193
name: "license:commercial_use_allowed no",
194194
h: OperatorRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseCommercialUseAllowed: "no"}},
195195
selector: "operators.#.onestop_id",
196-
expectSelect: []string{"o-9q9-bayarearapidtransit"},
196+
expectSelect: []string{"o-unknown-hopelinktransportation", "o-9q9-bayarearapidtransit"},
197197
},
198198
{
199199
name: "license:commercial_use_allowed exclude_no",
@@ -211,7 +211,7 @@ func TestOperatorRequest_License(t *testing.T) {
211211
name: "license:create_derived_product no",
212212
h: OperatorRequest{WithCursor: WithCursor{Limit: 10_000}, LicenseFilter: LicenseFilter{LicenseCreateDerivedProduct: "no"}},
213213
selector: "operators.#.onestop_id",
214-
expectSelect: []string{"o-9q9-bayarearapidtransit"},
214+
expectSelect: []string{"o-unknown-hopelinktransportation", "o-9q9-bayarearapidtransit"},
215215
},
216216
{
217217
name: "license:create_derived_product exclude_no",

0 commit comments

Comments
 (0)