def test_get_lib_version(self): object = ChartVersionConfig(version='1.0').to_dict() httpretty.register_uri(httpretty.GET, VersionClient._build_url( self.client.base_url, VersionClient.ENDPOINT, 'chart'), body=json.dumps(object), content_type='application/json', status=200) result = self.client.get_chart_version() assert object == result.to_dict()
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())
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())
def test_chart_version_config(self): config_dict = {'version': '2.2.2'} config = ChartVersionConfig.from_dict(config_dict) assert config.to_dict() == config_dict
def retrieve(self, request, *args, **kwargs): chart_version = ChartVersion.load() return Response(ChartVersionConfig.obj_to_dict(chart_version))
def get_chart_version(self): request_url = self._build_url(self._get_http_url(), 'chart') response = self.get(request_url) data_dict = response.json() logger.debug("Lib Version info :{}".format(data_dict)) return ChartVersionConfig.from_dict(data_dict)