Ejemplo n.º 1
0
 def test_get_cli_version(self):
     object = CliVersionConfig(latest_version='1.0',
                               min_version='0.5').to_dict()
     httpretty.register_uri(httpretty.GET,
                            VersionClient._build_url(
                                self.client.base_url,
                                VersionClient.ENDPOINT),
                            body=json.dumps(object),
                            content_type='application/json',
                            status=200)
     result = self.client.get_cli_version()
     assert object == result.to_dict()
Ejemplo n.º 2
0
 def retrieve(self, request, *args, **kwargs):
     cli_version = CliVersionConfig.obj_to_dict(CliVersion.load())
     chart_version = ChartVersionConfig.obj_to_dict(ChartVersion.load())
     platform_version = PlatformVersionConfig.obj_to_dict(
         PlatformVersion.load())
     handler_config = LogHandlerConfig(
         dns=config.cli_dns,
         environment=config.env,
         tags={
             'cli_min_version': cli_version['min_version'],
             'cli_latest_version': cli_version['latest_version'],
             'platform_min_version': platform_version['min_version'],
             'platform_latest_version': platform_version['latest_version'],
             'chart_version': chart_version['version']
         })
     return Response(handler_config.to_dict())
Ejemplo n.º 3
0
 def retrieve(self, request, *args, **kwargs):
     cli_version = CliVersionConfig.obj_to_dict(CliVersion.load())
     chart_version = ChartVersionConfig.obj_to_dict(ChartVersion.load())
     platform_version = PlatformVersionConfig.obj_to_dict(PlatformVersion.load())
     handler_config = LogHandlerConfig(
         dns=config.cli_dns,
         environment=config.env,
         tags={
             'cli_min_version': cli_version['min_version'],
             'cli_latest_version': cli_version['latest_version'],
             'platform_min_version': platform_version['min_version'],
             'platform_latest_version': platform_version['latest_version'],
             'chart_version': chart_version['version']
         }
     )
     return Response(handler_config.to_dict())
Ejemplo n.º 4
0
 def test_cli_version_config(self):
     config_dict = {'latest_version': '2.2.2', 'min_version': '1.1.0'}
     config = CliVersionConfig.from_dict(config_dict)
     assert config.to_dict() == config_dict
Ejemplo n.º 5
0
 def retrieve(self, request, *args, **kwargs):
     cli_version = CliVersion.load()
     return Response(CliVersionConfig.obj_to_dict(cli_version))
Ejemplo n.º 6
0
 def get_cli_version(self):
     request_url = self._build_url(self._get_http_url(), 'cli')
     response = self.get(request_url)
     data_dict = response.json()
     logger.debug("CLI Version info :{}".format(data_dict))
     return CliVersionConfig.from_dict(data_dict)
Ejemplo n.º 7
0
 def get_cli_version(self):
     response = self.get(self._get_url())
     data_dict = response.json()
     logger.debug("CLI Version info :{}".format(data_dict))
     return CliVersionConfig.from_dict(data_dict)
Ejemplo n.º 8
0
 def retrieve(self, request, *args, **kwargs):
     cli_version = CliVersion.load()
     return Response(CliVersionConfig.obj_to_dict(cli_version))