예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 def test_get_usage(self):
     account.get_account_usage()
예제 #4
0
 def testUsageEmpty(self):
     httpretty.register_uri(httpretty.GET, common.get_metadata_url() + 'account/usage', body='{}')
     self.assertEqual(str(account.get_account_usage()), '')
예제 #5
0
파일: acd_cli.py 프로젝트: hansendc/acd_cli
def usage_action(args: argparse.Namespace):
    r = account.get_account_usage()
    print(r, end='')
예제 #6
0
 def test_get_usage(self):
     account.get_account_usage()
예제 #7
0
파일: acd_cli.py 프로젝트: nabcos/acd_cli
def usage_action(args: argparse.Namespace):
    r = account.get_account_usage()
    print(r, end='')
예제 #8
0
 def testUsageEmpty(self):
     httpretty.register_uri(httpretty.GET,
                            common.get_metadata_url() + 'account/usage',
                            body='{}')
     self.assertEqual(str(account.get_account_usage()), '')