Skip to content

Commit faf9021

Browse files
CSHARP-2880: Change uri_options/auth-options spec test to enable conditional tests
1 parent 9ac07a0 commit faf9021

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

tests/MongoDB.Driver.Core.Tests/Specifications/uri-options/tests/README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ array of test case objects, each of which have the following keys:
2121

2222
- ``description``: A string describing the test.
2323
- ``uri``: A string containing the URI to be parsed.
24-
- ``valid``: A boolean indicating if the URI should be considered valid.
25-
This will always be true, as the Connection String spec tests the validity of the structure, but
26-
it's still included to make it easier to reuse the connection string spec test runners that
27-
drivers already have.
24+
- ``valid``: A boolean indicating if the URI should be considered valid.
2825
- ``warning``: A boolean indicating whether URI parsing should emit a warning.
2926
- ``hosts``: Included for compatibility with the Connection String spec tests. This will always be ``~``.
3027
- ``auth``: Included for compatibility with the Connection String spec tests. This will always be ``~``.

tests/MongoDB.Driver.Core.Tests/Specifications/uri-options/tests/auth-options.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"tests": [
33
{
4-
"description": "Valid auth options are parsed correctly",
4+
"description": "Valid auth options are parsed correctly (GSSAPI)",
55
"uri": "mongodb://foo:[email protected]/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external",
66
"valid": true,
77
"warning": false,
@@ -15,6 +15,18 @@
1515
},
1616
"authSource": "$external"
1717
}
18+
},
19+
{
20+
"description": "Valid auth options are parsed correctly (SCRAM-SHA-1)",
21+
"uri": "mongodb://foo:[email protected]/?authMechanism=SCRAM-SHA-1&authSource=authSourceDB",
22+
"valid": true,
23+
"warning": false,
24+
"hosts": null,
25+
"auth": null,
26+
"options": {
27+
"authMechanism": "SCRAM-SHA-1",
28+
"authSource": "authSourceDB"
29+
}
1830
}
1931
]
2032
}

tests/MongoDB.Driver.Core.Tests/Specifications/uri-options/tests/auth-options.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests:
22
-
3-
description: "Valid auth options are parsed correctly"
3+
description: "Valid auth options are parsed correctly (GSSAPI)"
44
uri: "mongodb://foo:[email protected]/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external"
55
valid: true
66
warning: false
@@ -12,3 +12,13 @@ tests:
1212
SERVICE_NAME: "other"
1313
CANONICALIZE_HOST_NAME: true
1414
authSource: "$external"
15+
-
16+
description: "Valid auth options are parsed correctly (SCRAM-SHA-1)"
17+
uri: "mongodb://foo:[email protected]/?authMechanism=SCRAM-SHA-1&authSource=authSourceDB"
18+
valid: true
19+
warning: false
20+
hosts: ~
21+
auth: ~
22+
options:
23+
authMechanism: "SCRAM-SHA-1"
24+
authSource: "authSourceDB"

0 commit comments

Comments
 (0)