(self)
| 2138 | self.db.t.create_index({"x": pymongo.ASCENDING}) |
| 2139 | |
| 2140 | def test_legacy_java_uuid_roundtrip(self): |
| 2141 | data = BinaryData.java_data |
| 2142 | docs = bson.decode_all(data, CodecOptions(SON[str, Any], False, JAVA_LEGACY)) |
| 2143 | |
| 2144 | client_context.client.pymongo_test.drop_collection("java_uuid") |
| 2145 | db = client_context.client.pymongo_test |
| 2146 | coll = db.get_collection("java_uuid", CodecOptions(uuid_representation=JAVA_LEGACY)) |
| 2147 | |
| 2148 | coll.insert_many(docs) |
| 2149 | self.assertEqual(5, coll.count_documents({})) |
| 2150 | for d in coll.find(): |
| 2151 | self.assertEqual(d["newguid"], uuid.UUID(d["newguidstring"])) |
| 2152 | |
| 2153 | coll = db.get_collection("java_uuid", CodecOptions(uuid_representation=PYTHON_LEGACY)) |
| 2154 | for d in coll.find(): |
| 2155 | self.assertNotEqual(d["newguid"], d["newguidstring"]) |
| 2156 | client_context.client.pymongo_test.drop_collection("java_uuid") |
| 2157 | |
| 2158 | def test_legacy_csharp_uuid_roundtrip(self): |
| 2159 | data = BinaryData.csharp_data |
nothing calls this directly
no test coverage detected