Пример #1
0
 def test_30_do_not_store_non_dict(self):
     """an incoming non-dict should not get stored and
     an error message written"""
     cc = CouchDBConnect()
     cc.db = Mock()
     cc.log = Mock()
     cc.store("am I a dict?", ("localhost", 30000))
     self.assertFalse(cc.db.save.called)
     self.assertFalse(cc.log.msg.called)
     self.assertTrue(cc.log.err.called)
Пример #2
0
 def test_20_store_dict(self):
     """an incoming dict should get stored"""
     cc = CouchDBConnect()
     cc.db = Mock()
     cc.store({12: 13}, ("localhost", 30000))
     self.assertTrue(cc.db.save.called)