Makes the xstatic files lookup dynamic in the tests

This change makes it so the tests will look for the actual
python folder where the xstatic files are located instead
of looking only for a python2.7/ folder.

Change-Id: Ib2a56475b79b002085922ab752038239635fb9a5
Closes-bug: #1706980
This commit is contained in:
Pascal Boutin 2017-07-27 10:01:33 -04:00
parent e5339c35d0
commit 0dc5a8230e
2 changed files with 10 additions and 8 deletions

View File

@ -22,14 +22,15 @@ var path = require('path');
module.exports = function (config) {
var xstaticPath = path.resolve('./.tox/npm');
if (fs.existsSync(xstaticPath)) {
xstaticPath += '/lib/python2.7/site-packages/xstatic/pkg/';
}
if (!xstaticPath) {
console.error('xStatic libraries not found, please run `tox -e npm`');
process.exit(1);
}
xstaticPath += '/lib/';
xstaticPath += fs.readdirSync(xstaticPath).find(function(directory) {
return directory.indexOf('python') === 0;
});
xstaticPath += '/site-packages/xstatic/pkg/';
config.set({
preprocessors: {

View File

@ -22,14 +22,15 @@ var path = require('path');
module.exports = function (config) {
var xstaticPath = path.resolve('./.tox/npm');
if (fs.existsSync(xstaticPath)) {
xstaticPath += '/lib/python2.7/site-packages/xstatic/pkg/';
}
if (!xstaticPath) {
console.error('xStatic libraries not found, please run `tox -e npm`');
process.exit(1);
}
xstaticPath += '/lib/';
xstaticPath += fs.readdirSync(xstaticPath).find(function(directory) {
return directory.indexOf('python') === 0;
});
xstaticPath += '/site-packages/xstatic/pkg/';
config.set({
preprocessors: {