• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..08-Jan-2020-

README.rstH A D08-Jan-20202.3 KiB5340

auth-options.jsonH A D08-Jan-2020563 2120

auth-options.ymlH A D08-Jan-2020520 1514

ca.pemH A D08-Jan-2020149 21

cert.pemH A D08-Jan-2020149 21

client.pemH A D08-Jan-2020149 21

compression-options.jsonH A D08-Jan-20201.5 KiB6059

compression-options.ymlH A D08-Jan-20201.4 KiB4947

concern-options.jsonH A D08-Jan-20201.9 KiB7776

concern-options.ymlH A D08-Jan-20201.6 KiB5655

connection-options.jsonH A D08-Jan-20203.5 KiB123122

connection-options.ymlH A D08-Jan-20203.3 KiB107106

connection-pool-options.jsonH A D08-Jan-2020794 3433

connection-pool-options.ymlH A D08-Jan-2020716 2726

read-preference-options.jsonH A D08-Jan-20201.3 KiB5352

read-preference-options.ymlH A D08-Jan-20201.2 KiB4341

single-threaded-options.jsonH A D08-Jan-2020609 2524

single-threaded-options.ymlH A D08-Jan-2020550 1918

tls-options.jsonH A D08-Jan-20206.7 KiB232231

tls-options.ymlH A D08-Jan-20206.2 KiB201200

README.rst

1=======================
2URI Options Tests
3=======================
4
5The YAML and JSON files in this directory tree are platform-independent tests
6that drivers can use to prove their conformance to the URI Options spec.
7
8These tests use the same format as the Connection String spec tests.
9
10Version
11-------
12
13Files in the "specifications" repository have no version scheme. They are not
14tied to a MongoDB server version.
15
16Format
17------
18
19Each YAML file contains an object with a single ``tests`` key. This key is an
20array of test case objects, each of which have the following keys:
21
22- ``description``: A string describing the test.
23- ``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.
28- ``warning``: A boolean indicating whether URI parsing should emit a warning.
29- ``hosts``: Included for compatibility with the Connection String spec tests. This will always be ``~``.
30- ``auth``: Included for compatibility with the Connection String spec tests. This will always be ``~``.
31- ``options``: An object containing key/value pairs for each parsed query string
32  option.
33
34If a test case includes a null value for one of these keys (e.g. ``auth: ~``,
35``hosts: ~``), no assertion is necessary. This both simplifies parsing of the
36test files (keys should always exist) and allows flexibility for drivers that
37might substitute default values *during* parsing (e.g. omitted ``hosts`` could be
38parsed as ``["localhost"]``).
39
40The ``valid`` and ``warning`` fields are boolean in order to keep the tests
41flexible. We are not concerned with asserting the format of specific error or
42warnings messages strings.
43
44Use as unit tests
45=================
46
47Testing whether a URI is valid or not requires testing whether URI parsing (or
48MongoClient construction) causes a warning due to a URI option being invalid and asserting that the
49options parsed from the URI match those listed in the ``options`` field.
50
51Note that there are tests for each of the options marked as optional; drivers will need to implement
52logic to skip over the optional tests that they don’t implement.
53