def test_lookup_predicates(self): """different lookups checked""" # main combination predicate req = GbifDownload("name", "email") req.main_pred_type = "|" self.assertEqual(req.payload['predicate']['type'], "or") # predicate addition req.add_predicate("YEAR", "2000", ">=") self.assertEqual(req.payload["predicate"]["predicates"][0]["type"], "greaterThanOrEquals")
def test_add_predicate(self): """test the predicate addition""" req = GbifDownload("name", "email") req.add_predicate("COUNTRY", "BE", "equals") self.assertIsInstance(req.payload["predicate"]["predicates"], list) self.assertEquals(len(req.payload["predicate"]["predicates"]), 1) self.assertIsInstance(req.payload["predicate"]["predicates"][0], dict) self.assertDictEqual(req.payload["predicate"]["predicates"][0], {'key': 'COUNTRY', 'type': 'equals', 'value': 'BE'})
def test_add_predicate(self): """test the predicate addition""" req = GbifDownload("name", "email") req.add_predicate("COUNTRY", "BE", "equals") self.assertIsInstance(req.payload["predicate"]["predicates"], list) self.assertEquals(len(req.payload["predicate"]["predicates"]), 1) self.assertIsInstance(req.payload["predicate"]["predicates"][0], dict) self.assertDictEqual(req.payload["predicate"]["predicates"][0], {'key': 'COUNTRY', 'type': 'equals', 'value': 'BE'})
def test_lookup_predicates(self): """different lookups checked""" # main combination predicate req = GbifDownload("name", "email") req.main_pred_type = "|" self.assertEqual(req.payload['predicate']['type'], "or") # predicate addition req.add_predicate("YEAR", "2000", ">=") self.assertEqual(req.payload["predicate"]["predicates"][0]["type"], "greaterThanOrEquals")
def test_add_predicate(self): """test the predicate addition""" req = GbifDownload("name", "email") req.add_predicate("COUNTRY", "BE", "equals") self.assertIsInstance(req.payload["predicate"]["predicates"], list) self.assertEquals(len(req.payload["predicate"]["predicates"]), 1) self.assertIsInstance(req.payload["predicate"]["predicates"][0], dict) self.assertDictEqual( req.payload["predicate"]["predicates"][0], { "key": "COUNTRY", "type": "equals", "value": "BE" }, )