diff --git a/package.json b/package.json index 3ea73692..5a7ee4a1 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ "mapnik-reference": "~8.5.1", "carto": "0.15.3", "tilelive": "~5.9.0", - "tilelive-bridge": "~2.1.0", + "tilelive-bridge": "~2.2.1", "tilelive-vector": "~3.5.0", - "mapnik-omnivore": "~6.3.0", - "gdal": "0.7.0", + "mapnik-omnivore": "~6.3.2", + "gdal": "~0.7.2", "abaculus": "1.2.1", "mapbox-machine-styles": "2.3.1", "mapbox-studio-pro-fonts": "https://mapbox-npm.s3.amazonaws.com/package/mapbox-studio-pro-fonts-1.0.0-9870a90b713f307b9391829602f4d5857e419615.tgz", diff --git a/test/source.test.js b/test/source.test.js index ce5a854f..0f6a9c58 100644 --- a/test/source.test.js +++ b/test/source.test.js @@ -7,6 +7,7 @@ var assert = require('assert'); var upload = require('mapbox-upload'); var tm = require('../lib/tm'); var source = require('../lib/source'); +var mkdirp = require('mkdirp'); var tilelive = require('tilelive'); var testutil = require('./util'); var mockOauth = require('../lib/mapbox-mock')(require('express')()); @@ -352,14 +353,33 @@ test('local: saves source to disk', function(t) { }); test('local: save as tmp => perm', function(t) { - var tmpid = 'tmpsource://' + tm.join(__dirname, '/fixtures-local source'); + var source_dir = tm.join(__dirname, '/fixtures-local source'); + var tmpid = 'tmpsource://' + source_dir; source.info(tmpid, function(err, data) { t.ifError(err); var permid = path.join(tmp, 'source-saveas-' + Math.random().toString(36).split('.').pop()); + mkdirp.sync(permid); + [ + '10m-900913-bounding-box.dbf', + '10m-900913-bounding-box.shx', + '10m-900913-bounding-box.index', + '10m-900913-bounding-box.shp', + '10m_lakes_historic.dbf', + '10m_lakes_historic.shx', + '10m_lakes_historic.index', + '10m_lakes_historic.shp' + ].forEach(function(f) { + fs.writeFileSync(path.join(permid,f),fs.readFileSync(path.join(source_dir,f))); + }); source.save(_({_tmp:tmpid, id:permid}).defaults(data), function(err, source) { t.ifError(err); t.ok(source); - t.equal(source.data._tmp, false); + if (source) { + t.ok(source.data); + if (source.data) { + t.equal(source.data._tmp, false); + } + } var tmpdir = tm.parse(permid).dirname; t.ok(fs.existsSync(tm.join(tmpdir,'data.yml'))); t.ok(fs.existsSync(tm.join(tmpdir,'data.xml'))); @@ -463,7 +483,7 @@ test('source.mbtilesExport: verify export', function(t) { src._db.get('select count(1) as count, sum(length(tile_data)) as size from tiles;', function(err, row) { t.ifError(err); t.equal(row.count, 5461); - t.equal(row.size, 377696); + t.equal(row.size, 377704); check([ [0,0,0], [1,0,0],