Add nodejs test for dataset name
This commit is contained in:
committed by
Patrick Niklaus
parent
2c80f76004
commit
0e8b8b4901
+10
-3
@@ -100,9 +100,16 @@ test('constructor: autoswitches to CoreCH for a CH dataset if capable', function
|
||||
|
||||
test('constructor: throws if data doesn\'t match algorithm', function(assert) {
|
||||
assert.plan(3);
|
||||
assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, 'CoreCH with MLD data');
|
||||
assert.ok(function() { new OSRM({algorithm: 'CoreCH', path: monaco_path}); }, 'CoreCH with CH data');
|
||||
assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, 'MLD with CH data');
|
||||
assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data');
|
||||
assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data');
|
||||
assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data');
|
||||
});
|
||||
|
||||
test('constructor: throws if dataset_name is not a string', function(assert) {
|
||||
assert.plan(3);
|
||||
assert.throws(function() { new OSRM({dataset_name: 1337, path: monaco_mld_path}); }, /dataset_name needs to be a string/, 'Does not accept int');
|
||||
assert.ok(new OSRM({dataset_name: "", shared_memory: true}), 'Does accept string');
|
||||
assert.throws(function() { new OSRM({dataset_name: "unsued_name___", shared_memory: true}); }, /Could not find shared memory region/, 'Does not accept wrong name');
|
||||
});
|
||||
|
||||
test('constructor: parses custom limits', function(assert) {
|
||||
|
||||
Reference in New Issue
Block a user