示例#1
0
    def test_date_2(self):
        date_str = "2015-09-14 16:42:45"
        conv_date_secs = test_utils.get_secs(date_str)
        query = ("created = '%s'" % date_str)
        arg = "a"
        resp, status = test_func(
            arg,
            query
        )

        # Asserting non-zero amount of responses.
        self.assertGreater(len(resp), 0)
        for e in resp:
            # Convert to time
            self.assertEqual(test_utils.get_secs(e["Created"]), conv_date_secs)
示例#2
0
    def test_or_operation(self):
        name = "silly_leakey"
        created = "2015-09-14"
        created_secs = test_utils.get_secs(created)
        query = (
            "name = '%s' or created > '%s'"
            %
            (name, created)
        )
        arg = "a"
        resp, status = test_func(
            arg,
            query
        )

        self.assertGreater(len(resp), 0)

        for e in resp:
            cond = (
                e["Name"] == ("/%s" % name) or
                test_utils.get_secs(e["Created"]) > created_secs
            )
            self.assertTrue(cond)