github.com/kubeflow/training-operator@v1.7.0/sdk/python/test/test_kubeflow_org_v1_elastic_policy.py (about)

     1  # coding: utf-8
     2  
     3  """
     4      Kubeflow Training SDK
     5  
     6      Python SDK for Kubeflow Training  # noqa: E501
     7  
     8      The version of the OpenAPI document: v1.7.0
     9      Generated by: https://openapi-generator.tech
    10  """
    11  
    12  
    13  from __future__ import absolute_import
    14  
    15  import unittest
    16  import datetime
    17  
    18  from kubeflow.training.models import *
    19  from kubeflow.training.models.kubeflow_org_v1_elastic_policy import KubeflowOrgV1ElasticPolicy  # noqa: E501
    20  from kubeflow.training.rest import ApiException
    21  
    22  class TestKubeflowOrgV1ElasticPolicy(unittest.TestCase):
    23      """KubeflowOrgV1ElasticPolicy unit test stubs"""
    24  
    25      def setUp(self):
    26          pass
    27  
    28      def tearDown(self):
    29          pass
    30  
    31      def make_instance(self, include_optional):
    32          """Test KubeflowOrgV1ElasticPolicy
    33              include_option is a boolean, when False only required
    34              params are included, when True both required and
    35              optional params are included """
    36          # model = kubeflow.training.models.kubeflow_org_v1_elastic_policy.KubeflowOrgV1ElasticPolicy()  # noqa: E501
    37          if include_optional :
    38              return KubeflowOrgV1ElasticPolicy(
    39                  max_replicas = 56, 
    40                  max_restarts = 56, 
    41                  metrics = [
    42                      None
    43                      ], 
    44                  min_replicas = 56, 
    45                  n_proc_per_node = 56, 
    46                  rdzv_backend = '0', 
    47                  rdzv_conf = [
    48                      kubeflow_org_v1_rdzv_conf.KubeflowOrgV1RDZVConf(
    49                          key = '0', 
    50                          value = '0', )
    51                      ], 
    52                  rdzv_host = '0', 
    53                  rdzv_id = '0', 
    54                  rdzv_port = 56, 
    55                  standalone = True
    56              )
    57          else :
    58              return KubeflowOrgV1ElasticPolicy(
    59          )
    60  
    61      def testKubeflowOrgV1ElasticPolicy(self):
    62          """Test KubeflowOrgV1ElasticPolicy"""
    63          inst_req_only = self.make_instance(include_optional=False)
    64          inst_req_and_optional = self.make_instance(include_optional=True)
    65  
    66  
    67  if __name__ == '__main__':
    68      unittest.main()