示例#1
0
    def test18a_usage_by_date(self):
        """ Should return usage values for a specific date """
        yesterday = datetime.now() - timedelta(1)

        result_1 = api.usage(date=yesterday)
        self.assert_usage_result(result_1)

        result_2 = api.usage(date=utils.encode_date_to_usage_api_format(yesterday))
        self.assert_usage_result(result_2)

        # Verify that the structure of the response is of a single day
        self.assertNotIn("limit", result_1["bandwidth"])
        self.assertNotIn("used_percent", result_1["bandwidth"])

        self.assertNotIn("limit", result_2["bandwidth"])
        self.assertNotIn("used_percent", result_2["bandwidth"])
示例#2
0
 def test18_usage(self):
     """ should support usage API """
     self.assertIn("last_updated", api.usage())
示例#3
0
 def test18_usage(self):
     """ should support usage API """
     self.assert_usage_result(api.usage())