def testUsage(self): httpretty. \ register_uri(httpretty.GET, common.get_metadata_url() + 'account/usage', body=json.dumps({"lastCalculated": "2014-08-13T23:17:41.365Z", "video": {"billable": {"bytes": 23524252, "count": 22}, "total": {"bytes": 23524252, "count": 22}}, "other": {"billable": {"bytes": 29999771, "count": 871}, "total": {"bytes": 29999771, "count": 871}}, "doc": {"billable": {"bytes": 807170, "count": 10}, "total": {"bytes": 807170, "count": 10}}, "photo": {"billable": {"bytes": 9477988, "count": 25}, "total": {"bytes": 9477988, "count": 25}}}) ) self.assertIsInstance(account.get_account_usage(), account._Usage)
def test_get_usage(self): account.get_account_usage()
def testUsageEmpty(self): httpretty.register_uri(httpretty.GET, common.get_metadata_url() + 'account/usage', body='{}') self.assertEqual(str(account.get_account_usage()), '')
def usage_action(args: argparse.Namespace): r = account.get_account_usage() print(r, end='')