[server]: Manually add missing Luas stops

This commit is contained in:
2025-04-05 18:03:27 +01:00
parent 24c0028711
commit 191ddf8a31
2 changed files with 156 additions and 1 deletions

View File

@ -96,6 +96,161 @@ def fetch_luas():
"luasStopZoneCountA": stop["ZoneCountA"], "luasStopZoneCountA": stop["ZoneCountA"],
"luasStopZoneCountB": stop["ZoneCountB"] "luasStopZoneCountB": stop["ZoneCountB"]
} for stop in tsv_reader] } for stop in tsv_reader]
stops += [
{
# dawson luas stop
"objectID": "LuasStop-DAW",
"objectType": "LuasStop",
"latitude": 53.34235198108542,
"longitude": -6.257874705533702,
"luasStopName": "Dawson",
"luasStopIrishName": "Dásain",
"luasStopCode": "DAW",
"luasStopLineID": 2,
},
{
# westmoreland luas stop
"objectID": "LuasStop-WES",
"objectType": "LuasStop",
"latitude": 53.34657666552001,
"longitude": -6.258954552531184,
"luasStopName": "Westmoreland",
"luasStopIrishName": "Sráid Westmoreland",
"luasStopCode": "WES",
"luasStopLineID": 2,
},
{
# o connell gpo
"objectID": "LuasStop-OGP",
"objectType": "LuasStop",
"latitude": 53.34895364842052,
"longitude": -6.259870172748866,
"luasStopName": "O'Connell - GPO",
"luasStopIrishName": " Ó Conaill - AOP",
"luasStopCode": "OGP",
"luasStopLineID": 2,
},
{
# o connell upper
"objectID": "LuasStop-OUP",
"objectType": "LuasStop",
"latitude": 53.34897926629319,
"longitude": -6.259956003433765,
"luasStopName": "O'Connell - Upper",
"luasStopIrishName": "Ó Conaill Uachtarach",
"luasStopCode": "OUP",
"luasStopLineID": 2,
},
{
# broombridge
"objectID": "LuasStop-BRO",
"objectType": "LuasStop",
"latitude": 53.37238519438793,
"longitude": -6.29767637274806,
"luasStopName": "Broombridge",
"luasStopIrishName": "Droichead Broom",
"luasStopCode": "BRO",
"luasStopLineID": 2,
},
{
# cabra
"objectID": "LuasStop-CAB",
"objectType": "LuasStop",
"latitude": 53.3647720048475,
"longitude": -6.2818402941276315,
"luasStopName": "Cabra",
"luasStopIrishName": "Cabrach",
"luasStopCode": "CAB",
"luasStopLineID": 2,
},
{
# phibsborough
"objectID": "LuasStop-PHI",
"objectType": "LuasStop",
"latitude": 53.360531943612585,
"longitude": -6.278946230419645,
"luasStopName": "Phibsborough",
"luasStopIrishName": "Baile Phib",
"luasStopCode": "PHI",
"luasStopLineID": 2,
},
{
# grangegorman
"objectID": "LuasStop-GRA",
"objectType": "LuasStop",
"latitude": 53.35733203671144,
"longitude": -6.277386018855522,
"luasStopName": "Grangegorman",
"luasStopIrishName": "Gráinseach Ghormáin",
"luasStopCode": "GRA",
"luasStopLineID": 2,
},
{
# broadstone
"objectID": "LuasStop-BRD",
"objectType": "LuasStop",
"latitude": 53.354153216627836,
"longitude": -6.27358994584398,
"luasStopName": "Broadstone - University",
"luasStopIrishName": "An Clocháin Leathan",
"luasStopCode": "BRD",
"luasStopLineID": 2,
},
{
# dominick
"objectID": "LuasStop-DOM",
"objectType": "LuasStop",
"latitude": 53.351380458718346,
"longitude": -6.265691018855716,
"luasStopName": "Dominick",
"luasStopIrishName": "Doiminic",
"luasStopCode": "DOM",
"luasStopLineID": 2,
},
{
# parnell
"objectID": "LuasStop-PAR",
"objectType": "LuasStop",
"latitude": 53.35309164558487,
"longitude": -6.260360288173493,
"luasStopName": "Parnell",
"luasStopIrishName": "Sráid Pharnell",
"luasStopCode": "PAR",
"luasStopLineID": 2,
},
{
# marlborough
"objectID": "LuasStop-MAR",
"objectType": "LuasStop",
"latitude": 53.34937746503714,
"longitude": -6.257806103514667,
"luasStopName": "Marlborough",
"luasStopIrishName": "Maoilbhríde",
"luasStopCode": "MAR",
"luasStopLineID": 2,
},
{
# marlborough
"objectID": "LuasStop-MAR",
"objectType": "LuasStop",
"latitude": 53.34937746503714,
"longitude": -6.257806103514667,
"luasStopName": "Marlborough",
"luasStopIrishName": "Maoilbhríde",
"luasStopCode": "MAR",
"luasStopLineID": 2,
}
]
return stops return stops
def fetch_gtfs(): def fetch_gtfs():

View File

@ -66,7 +66,7 @@ class TestPermanentData(unittest.TestCase):
mock_get.return_value.content = 'Abbreviation\tName\tIrishName\tLatitude\tLongitude\tStopID\tLineID\tSortOrder\tIsEnabled\tIsParkAndRide\tIsCycleAndRide\tZoneCountA\tZoneCountB\nABB\tAbbey Street\tSráid na Mainistreach\t53.0\t-6.0\t1\t1\t1\ttrue\tfalse\tfalse\t1\t2'.encode('utf-8-sig') mock_get.return_value.content = 'Abbreviation\tName\tIrishName\tLatitude\tLongitude\tStopID\tLineID\tSortOrder\tIsEnabled\tIsParkAndRide\tIsCycleAndRide\tZoneCountA\tZoneCountB\nABB\tAbbey Street\tSráid na Mainistreach\t53.0\t-6.0\t1\t1\t1\ttrue\tfalse\tfalse\t1\t2'.encode('utf-8-sig')
result = fetch_luas() result = fetch_luas()
self.assertEqual(len(result), 1) self.assertEqual(len(result), 1 + 13)
self.assertEqual(result[0]['luasStopName'], 'Abbey Street') self.assertEqual(result[0]['luasStopName'], 'Abbey Street')
@patch('functions.fetch_permanent_data.lambda_function.session.get') @patch('functions.fetch_permanent_data.lambda_function.session.get')