1
0
Fork 0

Broken client API and server default was wrong (#3748)

This commit is contained in:
m0ppers 2017-11-21 17:19:14 +01:00 committed by Jan
parent ecb18dfded
commit ce537af092
2 changed files with 32 additions and 2 deletions

View File

@ -356,6 +356,11 @@ ArangoDatabase.prototype._create = function (name, properties, type, options) {
}
});
}
if (typeof type === 'object') {
options = type;
type = undefined;
}
let urlAddons = [];
if (typeof options === "object" && options !== null) {

View File

@ -374,8 +374,7 @@ function ClusterCollectionSuite () {
/// @brief test create
////////////////////////////////////////////////////////////////////////////////
testCreateInsufficientDBServers : function () {
testCreateInsufficientDBServersDefault : function () {
try {
db._create("bigreplication", {replicationFactor: 8});
fail();
@ -386,6 +385,32 @@ function ClusterCollectionSuite () {
db._drop('bigreplication');
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test create
////////////////////////////////////////////////////////////////////////////////
testCreateInsufficientDBServersIgnoreReplicationFactor : function () {
// should not throw (just a warning)
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: false});
db._drop('bigreplication');
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test create
////////////////////////////////////////////////////////////////////////////////
testCreateInsufficientDBServersEnforceReplicationFactor : function () {
try {
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: true});
fail();
}
catch (err) {
assertEqual(ERRORS.ERROR_CLUSTER_INSUFFICIENT_DBSERVERS.code, err.errorNum);
}
db._drop('bigreplication');
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test creation / deleting of documents with replication set
////////////////////////////////////////////////////////////////////////////////