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"])
def test18_usage(self): """ should support usage API """ self.assertIn("last_updated", api.usage())
def test18_usage(self): """ should support usage API """ self.assert_usage_result(api.usage())