mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
31 lines
615 B
Go
31 lines
615 B
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNewPublicTransportServiceLoadsFiles(t *testing.T) {
|
|
svc, err := NewPublicTransportService("data")
|
|
if err != nil {
|
|
t.Fatalf("failed to initialize service: %v", err)
|
|
}
|
|
|
|
if svc == nil {
|
|
t.Fatalf("service cannot be nil")
|
|
}
|
|
|
|
// metadata should exist (may be empty for fallback)
|
|
_ = svc.GetMetadata()
|
|
|
|
stops := svc.ListStops()
|
|
if stops == nil {
|
|
t.Fatalf("stops map must not be nil")
|
|
}
|
|
|
|
// Try reading a known GTFS file
|
|
_, err = svc.ReadGTFSFile("README.txt")
|
|
if err != nil {
|
|
t.Logf("warning: unable to read README.txt from GTFS export: %v", err)
|
|
}
|
|
}
|