Skip to content

Commit 647af83

Browse files
authored
Improve layout of testdata directory (#446)
1 parent 5edaf7b commit 647af83

File tree

284 files changed

+79
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+79
-155
lines changed

adapters/multireader/reader_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
)
1010

1111
func TestMultireader(t *testing.T) {
12-
reader1, err := tlcsv.NewReader(testpath.RelPath("testdata/external/bart.zip"))
12+
reader1, err := tlcsv.NewReader(testpath.RelPath("testdata/gtfs-external/bart.zip"))
1313
if err != nil {
1414
t.Fatal(err)
1515
}
16-
reader2, err := tlcsv.NewReader(testpath.RelPath("testdata/external/caltrain.zip"))
16+
reader2, err := tlcsv.NewReader(testpath.RelPath("testdata/gtfs-external/caltrain.zip"))
1717
if err != nil {
1818
t.Fatal(err)
1919
}

cmds/e2e_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestE2E(t *testing.T) {
3333
}{
3434
{
3535
name: "basic",
36-
fn: "testdata/example.zip",
36+
fn: "testdata/gtfs-examples/example.zip",
3737
activate: true,
3838
fvcount: 1,
3939
expectStops: 9,
@@ -42,7 +42,7 @@ func TestE2E(t *testing.T) {
4242
},
4343
{
4444
name: "basic no activate",
45-
fn: "testdata/example.zip",
45+
fn: "testdata/gtfs-examples/example.zip",
4646
activate: false,
4747
fvcount: 1,
4848
expectStops: 0,
@@ -51,7 +51,7 @@ func TestE2E(t *testing.T) {
5151
},
5252
{
5353
name: "basic unimport",
54-
fn: "testdata/example.zip",
54+
fn: "testdata/gtfs-examples/example.zip",
5555
activate: true,
5656
unimport: true,
5757
fvcount: 1,
@@ -61,7 +61,7 @@ func TestE2E(t *testing.T) {
6161
},
6262
{
6363
name: "basic unimport sched",
64-
fn: "testdata/example.zip",
64+
fn: "testdata/gtfs-examples/example.zip",
6565
activate: true,
6666
unimport: true,
6767
unimportSchedOnly: true,
@@ -72,7 +72,7 @@ func TestE2E(t *testing.T) {
7272
},
7373
{
7474
name: "basic nested dir",
75-
fn: "testdata/example-nested-dir.zip#example-nested-dir/example",
75+
fn: "testdata/gtfs-examples/example-nested-dir.zip#example-nested-dir/example",
7676
activate: true,
7777
fvcount: 1,
7878
expectStops: 9,
@@ -81,7 +81,7 @@ func TestE2E(t *testing.T) {
8181
},
8282
{
8383
name: "basic nested two feeds 1",
84-
fn: "testdata/example-nested-two-feeds.zip#example1",
84+
fn: "testdata/gtfs-examples/example-nested-two-feeds.zip#example1",
8585
activate: true,
8686
fvcount: 1,
8787
expectStops: 9,
@@ -91,7 +91,7 @@ func TestE2E(t *testing.T) {
9191

9292
{
9393
name: "basic nested two feeds 2",
94-
fn: "testdata/example-nested-two-feeds.zip#example2",
94+
fn: "testdata/gtfs-examples/example-nested-two-feeds.zip#example2",
9595
activate: true,
9696
fvcount: 1,
9797
expectStops: 9,
@@ -100,7 +100,7 @@ func TestE2E(t *testing.T) {
100100
},
101101
{
102102
name: "basic nested zip",
103-
fn: "testdata/example-nested-zip.zip#example-nested-zip/example.zip",
103+
fn: "testdata/gtfs-examples/example-nested-zip.zip#example-nested-zip/example.zip",
104104
activate: true,
105105
fvcount: 1,
106106
expectStops: 9,

cmds/fetch_cmd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ func TestFetchCommand(t *testing.T) {
2727
defer ts.Close()
2828

2929
// note - Spec==gtfs is required for fetch
30-
f200 := dmfr.Feed{FeedID: "f-200", Spec: "gtfs", URLs: dmfr.FeedUrls{StaticCurrent: fmt.Sprintf("%s/example.zip", ts.URL)}}
30+
f200 := dmfr.Feed{FeedID: "f-200", Spec: "gtfs", URLs: dmfr.FeedUrls{StaticCurrent: fmt.Sprintf("%s/gtfs-examples/example.zip", ts.URL)}}
3131
f404 := dmfr.Feed{FeedID: "f-404", Spec: "gtfs", URLs: dmfr.FeedUrls{StaticCurrent: fmt.Sprintf("%s/404", ts.URL)}}
32-
fvErrorExample := dmfr.Feed{FeedID: "f-error", Spec: "gtfs", URLs: dmfr.FeedUrls{StaticCurrent: fmt.Sprintf("%s/example-errors.zip", ts.URL)}}
32+
fvErrorExample := dmfr.Feed{FeedID: "f-error", Spec: "gtfs", URLs: dmfr.FeedUrls{StaticCurrent: fmt.Sprintf("%s/gtfs-examples/example-errors.zip", ts.URL)}}
3333
cases := []struct {
3434
name string
3535
fvcount int

doc/library-example.md

Lines changed: 1 addition & 1 deletion

ext/builders/convex_hull_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestConvexHullBuilder(t *testing.T) {
5050
},
5151
},
5252
"TriMet-2Routes": {
53-
testpath.RelPath("testdata/external/trimet-2routes.zip"),
53+
testpath.RelPath("testdata/gtfs-external/trimet-2routes.zip"),
5454
[]testcase{
5555
{
5656
FeedVersionGeometry: []float64{-122.567769, 45.435721, -122.671376, 45.493891, -122.698688, 45.530612, -122.696445, 45.531308, -122.621367, 45.532957, -122.578437, 45.533478, -122.563627, 45.530839, -122.563602, 45.530554, -122.563578, 45.530269, -122.567769, 45.435721},

ext/builders/route_geometry_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestRouteGeometryBuilder(t *testing.T) {
5151
},
5252
},
5353
"TriMet-2Routes": {
54-
testpath.RelPath("testdata/external/trimet-2routes.zip"),
54+
testpath.RelPath("testdata/gtfs-external/trimet-2routes.zip"),
5555
[]testcase{
5656
{RouteID: "193", ExpectLength: 6452.065660, ExpectLineStrings: 4},
5757
{RouteID: "200", ExpectLength: 23012.874312, ExpectLineStrings: 5},

ext/builders/route_headway_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestRouteHeadwayBuilder(t *testing.T) {
5555
},
5656
},
5757
"TriMet-2Routes": {
58-
testpath.RelPath("testdata/external/trimet-2routes.zip"),
58+
testpath.RelPath("testdata/gtfs-external/trimet-2routes.zip"),
5959
[]testcase{
6060
{RouteID: "193", DowCat: 1, DirectionID: 0, StopID: "10776", ServiceDate: "2021-10-18", HeadwaySecs: 960},
6161
{RouteID: "200", DowCat: 1, DirectionID: 0, StopID: "10293", ServiceDate: "2021-10-25", HeadwaySecs: 900},

ext/sched/sched_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestScheduleChecker(t *testing.T) {
6060
assert.ElementsMatch(t, tc.exp, stats)
6161
})
6262
}
63-
freqEx, err := newTestScheduleSchecker(testpath.RelPath("testdata/example.zip"))
63+
freqEx, err := newTestScheduleSchecker(testpath.RelPath("testdata/gtfs-examples/example.zip"))
6464
if err != nil {
6565
t.Fatal(err)
6666
}

extract/marker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestExtract_Bbox(t *testing.T) {
6767
}
6868

6969
func TestExtract_Filter_ExampleFeed(t *testing.T) {
70-
reader, err := tlcsv.NewReader(testpath.RelPath("testdata/extract-examples"))
70+
reader, err := tlcsv.NewReader(testpath.RelPath("testdata/gtfs-examples/extract-examples"))
7171
if err != nil {
7272
t.Error(err)
7373
}

fetch/static_fetch_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func TestStaticFetch(t *testing.T) {
3232
}{
3333
{
3434
name: "example.zip",
35-
serveFile: "testdata/example.zip",
36-
requestPath: "testdata/example.zip",
35+
serveFile: "testdata/gtfs-examples/example.zip",
36+
requestPath: "testdata/gtfs-examples/example.zip",
3737
responseSha1: "ce0a38dd6d4cfdac6aebe003181b6b915390a3b8",
3838
responseCode: 200,
3939
responseError: false,
@@ -42,7 +42,7 @@ func TestStaticFetch(t *testing.T) {
4242
},
4343
{
4444
name: "404",
45-
serveFile: "testdata/example.zip",
45+
serveFile: "testdata/gtfs-examples/example.zip",
4646
requestPath: "404.zip",
4747
responseSha1: "",
4848
responseCode: 404,
@@ -52,8 +52,8 @@ func TestStaticFetch(t *testing.T) {
5252
},
5353
{
5454
name: "invalid zip",
55-
serveFile: "testdata/invalid.zip",
56-
requestPath: "testdata/invalid.zip",
55+
serveFile: "testdata/gtfs-examples/invalid.zip",
56+
requestPath: "testdata/gtfs-examples/invalid.zip",
5757
responseSha1: "",
5858
responseCode: 200,
5959
responseError: true,
@@ -62,8 +62,8 @@ func TestStaticFetch(t *testing.T) {
6262
},
6363
{
6464
name: "nested dir",
65-
serveFile: "testdata/example-nested-dir.zip",
66-
requestPath: "testdata/example-nested-dir.zip#example-nested-dir/example",
65+
serveFile: "testdata/gtfs-examples/example-nested-dir.zip",
66+
requestPath: "testdata/gtfs-examples/example-nested-dir.zip#example-nested-dir/example",
6767
responseSha1: "",
6868
responseCode: 200,
6969
responseError: false,
@@ -72,8 +72,8 @@ func TestStaticFetch(t *testing.T) {
7272
},
7373
{
7474
name: "nested two feeds 1",
75-
serveFile: "testdata/example-nested-two-feeds.zip",
76-
requestPath: "testdata/example-nested-two-feeds.zip#example1",
75+
serveFile: "testdata/gtfs-examples/example-nested-two-feeds.zip",
76+
requestPath: "testdata/gtfs-examples/example-nested-two-feeds.zip#example1",
7777
responseSha1: "",
7878
responseCode: 200,
7979
responseError: false,
@@ -82,8 +82,8 @@ func TestStaticFetch(t *testing.T) {
8282
},
8383
{
8484
name: "nested two feeds 2",
85-
serveFile: "testdata/example-nested-two-feeds.zip",
86-
requestPath: "testdata/example-nested-two-feeds.zip#example2",
85+
serveFile: "testdata/gtfs-examples/example-nested-two-feeds.zip",
86+
requestPath: "testdata/gtfs-examples/example-nested-two-feeds.zip#example2",
8787
responseSha1: "",
8888
responseCode: 200,
8989
responseError: false,
@@ -92,8 +92,8 @@ func TestStaticFetch(t *testing.T) {
9292
},
9393
{
9494
name: "nested zip",
95-
serveFile: "testdata/example-nested-zip.zip",
96-
requestPath: "testdata/example-nested-zip.zip#example-nested-zip/example.zip",
95+
serveFile: "testdata/gtfs-examples/example-nested-zip.zip",
96+
requestPath: "testdata/gtfs-examples/example-nested-zip.zip#example-nested-zip/example.zip",
9797
responseSha1: "",
9898
responseCode: 200,
9999
responseError: false,
@@ -285,7 +285,7 @@ func TestStaticFetch_AdditionalTests(t *testing.T) {
285285
// So in this case, the second fetch will return Found and the existing FV.
286286
func TestStaticFetch_NestedTwoFeeds(t *testing.T) {
287287
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
288-
fp := testpath.RelPath("testdata/example-nested-two-feeds.zip")
288+
fp := testpath.RelPath("testdata/gtfs-examples/example-nested-two-feeds.zip")
289289
buf, err := os.ReadFile(fp)
290290
if err != nil {
291291
t.Error(err)

0 commit comments

Comments
 (0)