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'})
Example #3
0
 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'})
Example #4
0
    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")
Example #5
0
 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"
         },
     )