示例#1
0
 def test_store_dict_big(self):
     content = self._get_big_dict()
     dictionary = {'content': content}
     self.assertGreater(len(json.dumps(dictionary, cls=MongoJSONEncoder)), 1000000)
     store_dict(dictionary, {})
     self.assertIsNone(dictionary['content'])
     self.assertEqual(content, fetch_dict(dictionary))
     self.assertLess(len(json.dumps(dictionary, cls=MongoJSONEncoder)), 100)
示例#2
0
 def test_store_dict_small(self):
     content = {"foo": 1}
     dictionary = {"content": content}
     store_dict(dictionary, {})
     self.assertEqual(json.dumps(content), dictionary.get("content"))
     self.assertEqual(content, fetch_dict(dictionary))
 def test_store_dict_small(self):
     content = {'foo': 1}
     dictionary = {'content': content}
     store_dict(dictionary, {})
     self.assertEqual(json.dumps(content), dictionary.get('content'))
     self.assertEqual(content, fetch_dict(dictionary))
 def test_store_dict_small(self):
     content = {'foo': 1}
     dictionary = {'content': content}
     store_dict(dictionary, {})
     self.assertEqual(json.dumps(content), dictionary.get('content'))
     self.assertEqual(content, fetch_dict(dictionary))