MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_uniqueness

Method test_uniqueness

test/atlas/test_connection.py:98–108  ·  view source on GitHub ↗

Ensure that we don't accidentally duplicate the test URIs.

(self)

Source from the content-addressed store, hash-verified

96 self.connect(URIS["ATLAS_X509_DEV_WITH_CERT"])
97
98 def test_uniqueness(self):
99 """Ensure that we don't accidentally duplicate the test URIs."""
100 uri_to_names = defaultdict(list)
101 for name, uri in URIS.items():
102 if uri:
103 uri_to_names[uri].append(name)
104 duplicates = [names for names in uri_to_names.values() if len(names) > 1]
105 self.assertFalse(
106 duplicates,
107 f"Error: the following env variables have duplicate values: {duplicates}",
108 )
109
110
111if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

itemsMethod · 0.80
valuesMethod · 0.80

Tested by

no test coverage detected