Permalink
Browse files

add document_class to MasterSlaveConnection

  • Loading branch information...
Mike Dirolf
Mike Dirolf committed Jun 21, 2010
1 parent 537e9ce commit 8b76667b4250187a31e6b12df67f4497fc93991d
Showing with 8 additions and 3 deletions.
  1. +5 −0 pymongo/master_slave_connection.py
  2. +3 −3 test/test_master_slave_connection.py
@@ -66,6 +66,11 @@ def master(self):
def slaves(self):
return self.__slaves
+ # TODO this is a temporary hack PYTHON-136 is the right solution for this
+ @property
+ def document_class(self):
+ return dict
+
@property
def slave_okay(self):
"""Is it okay for this connection to connect directly to a slave?
@@ -98,7 +98,7 @@ def test_drop_database(self):
self.assertRaises(TypeError, self.connection.drop_database, 5)
self.assertRaises(TypeError, self.connection.drop_database, None)
- self.connection.pymongo_test.test.save({"dummy": u"object"})
+ self.connection.pymongo_test.test.save({"dummy": u"object"}, safe=True)
dbs = self.connection.database_names()
self.assert_("pymongo_test" in dbs)
self.connection.drop_database("pymongo_test")
@@ -171,7 +171,7 @@ def test_insert_find_one_with_pause(self):
self.db.test.remove({})
self.db.test.insert({"x": 5586})
- time.sleep(7)
+ time.sleep(11)
for _ in range(10):
try:
if 5586 != self.db.test.find_one()["x"]:
@@ -198,7 +198,7 @@ def cursor_count():
for i in range(10000):
db.test.insert({"i": i})
- time.sleep(6) # need to sleep to be sure this gets pulled...
+ time.sleep(11) # need to sleep to be sure this gets pulled...
self.assertEqual(before, cursor_count())

0 comments on commit 8b76667

Please sign in to comment.