File: test_mgmt_batchai_quota_and_usage.py

package info (click to toggle)
python-azure 20181112%2Bgit-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 407,300 kB
  • sloc: python: 717,190; makefile: 201; sh: 76
file content (25 lines) | stat: -rw-r--r-- 937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=line-too-long

from azure.mgmt.batchai import BatchAIManagementClient
from devtools_testutils import AzureMgmtTestCase

from helpers import Helpers


class JobTestCase(AzureMgmtTestCase):
    def setUp(self):
        super(JobTestCase, self).setUp()
        self.client = Helpers.create_batchai_client(self)  # type: BatchAIManagementClient

    def test_quota_and_usage(self):
        usages = list(self.client.usages.list(Helpers.LOCATION))
        self.assertGreater(len(usages), 0)
        for u in usages:
            self.assertIsNotNone(u.name)
            self.assertIsNotNone(u.unit)