mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
mobiliteit.lu: fix national-train product bitmasks 🐛
This commit is contained in:
parent
850ec9484a
commit
54b7d2845b
3 changed files with 53 additions and 1 deletions
|
@ -12,7 +12,7 @@ module.exports = [
|
|||
{
|
||||
id: 'national-train',
|
||||
mode: 'train',
|
||||
bitmasks: [6],
|
||||
bitmasks: [2, 4],
|
||||
name: 'national train (IC/RE/IRE)',
|
||||
short: 'IC/RE/IRE',
|
||||
default: true
|
||||
|
|
|
@ -19,6 +19,7 @@ require('./rejseplanen-trip')
|
|||
require('./vsn-remarks')
|
||||
require('./db-netz-remarks')
|
||||
require('./vsn-departures')
|
||||
require('./mobiliteit-lu-line')
|
||||
|
||||
require('./throttle')
|
||||
require('./retry')
|
||||
|
|
51
test/mobiliteit-lu-line.js
Normal file
51
test/mobiliteit-lu-line.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict'
|
||||
|
||||
const test = require('tape')
|
||||
|
||||
const createClient = require('..')
|
||||
const rawProfile = require('../p/mobiliteit-lu')
|
||||
|
||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test')
|
||||
const {profile} = client
|
||||
|
||||
const opt = {
|
||||
linesOfStops: false, // parse & expose lines at the stop/station?
|
||||
remarks: true,
|
||||
}
|
||||
|
||||
test('parses a line correctly (mobiliteit.lu)', (t) => {
|
||||
const rawLine = {
|
||||
pid: 'L::1::IC::B1303038328::IC_1303038328::*',
|
||||
name: 'IC 108',
|
||||
number: '108',
|
||||
icoX: 0,
|
||||
cls: 2,
|
||||
oprX: 0,
|
||||
prodCtx: {
|
||||
name: 'IC 108',
|
||||
num: '108',
|
||||
matchId: '108',
|
||||
catOut: 'IC ',
|
||||
catOutS: 'CIC',
|
||||
catOutL: 'IC ',
|
||||
catIn: 'CIC',
|
||||
catCode: '1',
|
||||
admin: 'C88---',
|
||||
},
|
||||
}
|
||||
|
||||
const ctx = {profile, opt}
|
||||
const stop = profile.parseLine(ctx, rawLine)
|
||||
|
||||
t.deepEqual(stop, {
|
||||
type: 'line',
|
||||
id: 'ic-108',
|
||||
fahrtNr: '108',
|
||||
name: 'IC 108',
|
||||
public: true,
|
||||
adminCode: 'C88',
|
||||
mode: 'train',
|
||||
product: 'national-train',
|
||||
})
|
||||
t.end()
|
||||
})
|
Loading…
Add table
Reference in a new issue