test(plugins): plugin load + configure tests added

This commit is contained in:
Damian Mee 2014-08-21 04:10:13 +02:00
parent f97fda585f
commit edffd2f595
11 changed files with 509 additions and 267 deletions

75
test/mocks/config.json Normal file
View file

@ -0,0 +1,75 @@
{
"exchanges": {
"settings": {
"compliance": {
"maximum": {
"limit": null
}
},
"commission": 1,
"fastPoll": 5000,
"fastPollLimit": 10,
"tickerInterval": 5000,
"balanceInterval": 5000,
"tradeInterval": 5000,
"retryInterval": 5000,
"retries": 3,
"lowBalanceMargin": 1.05,
"transactionFee": 10000,
"tickerDelta": 0,
"minimumTradeFiat": 0,
"currency": "PLN",
"networkTimeout": 20000
},
"plugins": {
"current": {
"ticker": "mockTicker",
"trade": "mockTrader",
"wallet": "mockWallet",
"transfer": "mockWallet",
"idVerifier": "mockVerifier"
},
"settings": {
"bitpay": { },
"bitstamp": {
"currency": "USD",
"key": "",
"secret": "",
"clientId": ""
},
"blockchain": {
"retryInterval": 10000,
"retryTimeout": 60000,
"guid": "",
"password": "",
"fromAddress": ""
}
}
}
},
"brain": {
"qrTimeout": 60000,
"goodbyeTimeout": 2000,
"billTimeout": 60000,
"completedTimeout": 60000,
"networkTimeout": 20000,
"triggerRetry": 5000,
"idleTime": 600000,
"checkIdleTime": 60000,
"maxProcessSize": 104857600,
"freeMemRatio": 0.15,
"unit": {
"ssn": "xx-1234-45",
"owner": "Lamassu, Inc. \/ Trofa \/ Portugal"
},
"locale": {
"currency": "PLN",
"localeInfo": {
"primaryLocale": "pl-PL",
"primaryLocales": [
"pl-PL"
]
}
}
}
}

9
test/mocks/ticker.js Normal file
View file

@ -0,0 +1,9 @@
'use strict';
module.exports = {
SUPPORTED_MODULES: [ 'ticker' ],
NAME: 'Mock Ticker',
config: function() {},
ticker: function() {}
};

11
test/mocks/trader.js Normal file
View file

@ -0,0 +1,11 @@
'use strict';
module.exports = {
SUPPORTED_MODULES: ['trader'],
NAME: 'Mock Trader',
config: function() {},
balance: function() {},
purchase: function() {},
sell: function() {}
};

10
test/mocks/verifier.js Normal file
View file

@ -0,0 +1,10 @@
'use strict';
module.exports = {
SUPPORTED_MODULES: ['idVerifier'],
NAME: 'Mock Verifier',
config: function() {},
verifyUser: function() {},
verifyTransaction: function() {}
};

10
test/mocks/wallet.js Normal file
View file

@ -0,0 +1,10 @@
'use strict';
module.exports = {
SUPPORTED_MODULES: ['wallet'],
NAME: 'Mock Wallet',
config: function() {},
balance: function() {},
sendBitcoins: function() {}
};