PYTHON-2183 Test that readPreferenceTags are always interpreted as an array

Also resolves PYTHON-2085.
This commit is contained in:
Shane Harvey 2020-04-06 13:37:14 -07:00
parent fd64f4dd64
commit d42c5105cd
3 changed files with 28 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{
"tests": [
{
"description": "Valid auth options are parsed correctly",
"description": "Valid auth options are parsed correctly (GSSAPI)",
"uri": "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external",
"valid": true,
"warning": false,
@ -15,6 +15,18 @@
},
"authSource": "$external"
}
},
{
"description": "Valid auth options are parsed correctly (SCRAM-SHA-1)",
"uri": "mongodb://foo:bar@example.com/?authMechanism=SCRAM-SHA-1&authSource=authSourceDB",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"authMechanism": "SCRAM-SHA-1",
"authSource": "authSourceDB"
}
}
]
}

View File

@ -36,15 +36,6 @@
"w": "arbitraryButStillValid"
}
},
{
"description": "Too low w causes a warning",
"uri": "mongodb://example.com/?w=-2",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "Non-numeric wTimeoutMS causes a warning",
"uri": "mongodb://example.com/?wTimeoutMS=invalid",

View File

@ -21,6 +21,21 @@
"maxStalenessSeconds": 120
}
},
{
"description": "Single readPreferenceTags is parsed as array of size one",
"uri": "mongodb://example.com/?readPreferenceTags=dc:ny",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"readPreferenceTags": [
{
"dc": "ny"
}
]
}
},
{
"description": "Invalid readPreferenceTags causes a warning",
"uri": "mongodb://example.com/?readPreferenceTags=invalid",