MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_repr

Method test_repr

test/test_dbref.py:61–74  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

59 self.assertRaises(AttributeError, bar)
60
61 def test_repr(self):
62 self.assertEqual(
63 repr(DBRef("coll", ObjectId("1234567890abcdef12345678"))),
64 "DBRef('coll', ObjectId('1234567890abcdef12345678'))",
65 )
66 self.assertEqual(
67 repr(DBRef("coll", ObjectId("1234567890abcdef12345678"))),
68 "DBRef({}, ObjectId('1234567890abcdef12345678'))".format(repr("coll")),
69 )
70 self.assertEqual(repr(DBRef("coll", 5, foo="bar")), "DBRef('coll', 5, foo='bar')")
71 self.assertEqual(
72 repr(DBRef("coll", ObjectId("1234567890abcdef12345678"), "foo")),
73 "DBRef('coll', ObjectId('1234567890abcdef12345678'), 'foo')",
74 )
75
76 def test_equality(self):
77 obj_id = ObjectId("1234567890abcdef12345678")

Callers

nothing calls this directly

Calls 2

DBRefClass · 0.90
ObjectIdClass · 0.90

Tested by

no test coverage detected