示例#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}'
     )