Пример #1
0
 def test_reduce_setter(self):
     """
     Test that the reduce setter works
     """
     ddoc = DesignDocument(self.db, "ddoc001")
     view = View(ddoc, "view001")
     self.assertIsNone(view.get("reduce"))
     view.reduce = "_count"
     self.assertEqual(view.get("reduce"), "_count")
Пример #2
0
 def test_reduce_setter(self):
     """
     Test that the reduce setter works
     """
     ddoc = DesignDocument(self.db, 'ddoc001')
     view = View(ddoc, 'view001')
     self.assertIsNone(view.get('reduce'))
     view.reduce = '_count'
     self.assertEqual(view.get('reduce'), '_count')
Пример #3
0
 def test_map_setter(self):
     """
     Test that the map setter works
     """
     ddoc = DesignDocument(self.db, "ddoc001")
     view = View(ddoc, "view001")
     self.assertIsNone(view.get("map"))
     view.map = "function (doc) {\n  emit(doc._id, 1);\n}"
     self.assertEqual(view.get("map"), "function (doc) {\n  emit(doc._id, 1);\n}")
Пример #4
0
 def test_map_setter(self):
     """
     Test that the map setter works
     """
     ddoc = DesignDocument(self.db, 'ddoc001')
     view = View(ddoc, 'view001')
     self.assertIsNone(view.get('map'))
     view.map = 'function (doc) {\n  emit(doc._id, 1);\n}'
     self.assertEqual(
         view.get('map'),
         'function (doc) {\n  emit(doc._id, 1);\n}'
     )