def test_valid_option_group_level(self): """ Test group_level option is valid """ opts = {'group_level': 100} translation = python_to_couch(opts) self.assertEqual(translation['group_level'], 100)
def test_valid_option_types(self): """test with valid options""" opts = { "descending": True, "endkey": ['string'], "endkey_docid": 'string', "group": True, "group_level": "string", "include_docs": True, "inclusive_end": True, "key": 12, "limit": 12, "reduce": True, "skip": 12, "stale": "ok", "startkey": ["string"], "startkey_docid": "string" } result = python_to_couch(opts) self.assertEqual(result['include_docs'], 'true') self.assertEqual(result['endkey'], '["string"]') self.assertEqual(result['skip'], 12) self.assertEqual(result['endkey_docid'], '"string"') self.assertEqual(result['stale'], '"ok"')
def test_other_valid_option_combos(self): result = python_to_couch({"skip": None}) self.assertEqual(result['skip'], None)