UT: add test showing sending IOUs with source as issuer is broken.

This commit is contained in:
Arthur Britto
2013-03-08 13:56:33 -08:00
parent a3ee8b0ed1
commit 446120c456

View File

@@ -493,8 +493,8 @@ buster.testCase("Sending future", {
});
buster.testCase("Gateway", {
// 'setUp' : testutils.build_setup({ verbose: true }),
'setUp' : testutils.build_setup(),
// 'setUp' : testutils.build_setup(),
'setUp' : testutils.build_setup({ verbose: true }),
'tearDown' : testutils.build_teardown(),
"customer to customer with and without transfer fee" :
@@ -603,6 +603,156 @@ buster.testCase("Gateway", {
});
},
"customer to customer, transfer fee, default path with and without specific issuer for Amount and SendMax" :
function (done) {
var self = this;
// self.remote.set_trace();
async.waterfall([
function (callback) {
self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
},
function (callback) {
self.what = "Set transfer rate.";
self.remote.transaction()
.account_set("mtgox")
.transfer_rate(1e9*1.1)
.once('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Set credit limits.";
testutils.credit_limits(self.remote,
{
"alice" : "100/AUD/mtgox",
"bob" : "100/AUD/mtgox",
},
callback);
},
function (callback) {
self.what = "Distribute funds.";
testutils.payments(self.remote,
{
"mtgox" : [ "4.4/AUD/alice" ],
},
callback);
},
function (callback) {
self.what = "Verify balances.";
testutils.verify_balances(self.remote,
{
"alice" : "4.4/AUD/mtgox",
},
callback);
},
function (callback) {
self.what = "Alice sends 1.1/AUD/mtgox Bob 1/AUD/mtgox";
self.remote.transaction()
.payment("alice", "bob", "1/AUD/mtgox")
.send_max("1.1/AUD/mtgox")
.on('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Verify balances 2.";
testutils.verify_balances(self.remote,
{
"alice" : "3.3/AUD/mtgox",
"bob" : "1/AUD/mtgox",
},
callback);
},
function (callback) {
self.what = "Alice sends 1.1/AUD/mtgox Bob 1/AUD/bob";
self.remote.transaction()
.payment("alice", "bob", "1/AUD/bob")
.send_max("1.1/AUD/mtgox")
.on('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Verify balances 3.";
testutils.verify_balances(self.remote,
{
"alice" : "2.2/AUD/mtgox",
"bob" : "2/AUD/mtgox",
},
callback);
},
function (callback) {
self.what = "Alice sends 1.1/AUD/alice Bob 1/AUD/mtgox";
self.remote.transaction()
.payment("alice", "bob", "1/AUD/mtgox")
.send_max("1.1/AUD/alice")
.on('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Verify balances 4.";
testutils.verify_balances(self.remote,
{
"alice" : "1.1/AUD/mtgox",
"bob" : "3/AUD/mtgox",
},
callback);
},
function (callback) {
self.what = "Alice sends 1.1/AUD/alice Bob 1/AUD/bob";
self.remote.transaction()
.payment("alice", "bob", "1/AUD/bob")
.send_max("1.1/AUD/alice")
.on('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Verify balances 5.";
testutils.verify_balances(self.remote,
{
"alice" : "0/AUD/mtgox",
"bob" : "4/AUD/mtgox",
},
callback);
},
], function (error) {
buster.refute(error, self.what);
done();
});
},
"subscribe test: customer to customer with and without transfer fee" :
function (done) {
var self = this;