コード例 #1
0
ファイル: wfs.py プロジェクト: paulfvliz/GeoHealthCheck
    def perform_request(self):
        """ Perform actual request to service, overridden from base class"""

        if not self.feature_types:
            self.result.set(False, 'Found no WFS Feature Types')
            return

        self.result.start()

        results_failed_total = []
        for feature_type in self.feature_types:
            self._parameters['type_name'] = feature_type

            # Let the templated parent perform
            Probe.perform_request(self)
            self.run_checks()

            # Only keep failed feature_type results
            # otherwise with 100s of FTs the report grows out of hand...
            results_failed = self.result.results_failed
            if len(results_failed) > 0:
                # We have a failed feature_type: add to result message
                for result in results_failed:
                    result.message = 'feature_type %s: %s' % \
                                     (feature_type, result.message)

                results_failed_total += results_failed
                self.result.results_failed = []

            self.result.results = []

        self.result.results_failed = results_failed_total
コード例 #2
0
ファイル: tms.py プロジェクト: yangmaoer/GeoHealthCheck
    def perform_request(self):
        """ Perform actual request to service, overridden from base class"""

        if not self.layers:
            self.result.set(False, 'Found no TMS Layers')
            return

        self.result.start()

        results_failed_total = []
        for layer_name in self.layers.keys():
            # Layer name is last part of full URL
            self._parameters['layer'] = layer_name.split('1.0.0/')[-1]
            self._parameters['extension'] = self.layers[layer_name].extension

            # Let the templated parent perform
            Probe.perform_request(self)
            self.run_checks()

            # Only keep failed Layer results
            # otherwise with 100s of Layers the report grows out of hand...
            results_failed = self.result.results_failed
            if len(results_failed) > 0:
                # We have a failed layer: add to result message
                for result in results_failed:
                    result.message = 'layer %s: %s' % \
                                     (layer_name, result.message)

                results_failed_total += results_failed
                self.result.results_failed = []

            self.result.results = []

        self.result.results_failed = results_failed_total
        self.result.results = results_failed_total
コード例 #3
0
ファイル: wms.py プロジェクト: josegar74/GeoHealthCheck
    def perform_request(self):
        """ Perform actual request to service, overridden from base class"""

        if not self.layers:
            self.result.set(False, 'Found no WMS Layers')
            return

        self.result.start()

        results_failed_total = []
        for layer in self.layers:
            self._parameters['layers'] = [layer]

            # Let the templated parent perform
            Probe.perform_request(self)
            self.run_checks()

            # Only keep failed Layer results
            # otherwise with 100s of Layers the report grows out of hand...
            results_failed = self.result.results_failed
            if len(results_failed) > 0:
                # We have a failed layer: add to result message
                for result in results_failed:
                    result.message = 'layer %s: %s' % (layer, result.message)

                results_failed_total += results_failed
                self.result.results_failed = []

            self.result.results = []

        self.result.results_failed = results_failed_total
コード例 #4
0
ファイル: wfs.py プロジェクト: geopython/GeoHealthCheck
    def perform_request(self):
        """ Perform actual request to service, overridden from base class"""

        if not self.feature_types:
            self.result.set(False, 'Found no WFS Feature Types')
            return

        self.result.start()

        results_failed_total = []
        for feature_type in self.feature_types:
            self._parameters['type_name'] = feature_type

            # Let the templated parent perform
            Probe.perform_request(self)
            self.run_checks()

            # Only keep failed feature_type results
            # otherwise with 100s of FTs the report grows out of hand...
            results_failed = self.result.results_failed
            if len(results_failed) > 0:
                # We have a failed feature_type: add to result message
                for result in results_failed:
                    result.message = 'feature_type %s: %s' % \
                                     (feature_type, result.message)

                results_failed_total += results_failed
                self.result.results_failed = []

            self.result.results = []

        self.result.results_failed = results_failed_total
コード例 #5
0
ファイル: tms.py プロジェクト: geopython/GeoHealthCheck
    def perform_request(self):
        """ Perform actual request to service, overridden from base class"""

        if not self.layers:
            self.result.set(False, 'Found no TMS Layers')
            return

        self.result.start()

        results_failed_total = []
        for layer_name in self.layers.keys():
            # Layer name is last part of full URL
            self._parameters['layer'] = layer_name.split('1.0.0/')[-1]
            self._parameters['extension'] = self.layers[layer_name].extension

            # Let the templated parent perform
            Probe.perform_request(self)
            self.run_checks()

            # Only keep failed Layer results
            # otherwise with 100s of Layers the report grows out of hand...
            results_failed = self.result.results_failed
            if len(results_failed) > 0:
                # We have a failed layer: add to result message
                for result in results_failed:
                    result.message = 'layer %s: %s' % \
                                     (layer_name, result.message)

                results_failed_total += results_failed
                self.result.results_failed = []

            self.result.results = []

        self.result.results_failed = results_failed_total
        self.result.results = results_failed_total
コード例 #6
0
ファイル: http.py プロジェクト: jochemthart1/GeoHealthCheck
    def get_request_headers(self):
        """
        Overridden from Probe: construct request_headers
        via parameter substitution from content_type Parameter.
        """

        # content_type =
        # {'post_content_type': self._parameters['content_type']}
        # request_headers =
        #       self.REQUEST_HEADERS['content-type'].format(**content_type)
        # Hmm seems simpler
        headers = Probe.get_request_headers(self)
        return headers.update(
            {'Content-Type': self._parameters['content_type']})
コード例 #7
0
    def get_request_headers(self):
        headers = Probe.get_request_headers(self)

        # Clear possibly dangling ESRI header
        # https://github.com/geopython/GeoHealthCheck/issues/293
        if 'X-Esri-Authorization' in headers:
            del headers['X-Esri-Authorization']

        if 'Authorization' in headers:
            # https://enterprise.arcgis.com/en/server/latest/
            #     administer/linux/about-arcgis-tokens.htm
            auth_val = headers['Authorization']
            if 'Bearer' in auth_val:
                headers['X-Esri-Authorization'] = headers['Authorization']
        return headers
コード例 #8
0
 def __init__(self):
     Probe.__init__(self)
コード例 #9
0
ファイル: tms.py プロジェクト: yangmaoer/GeoHealthCheck
 def __init__(self):
     Probe.__init__(self)
     self.layer_count = 0
コード例 #10
0
 def __init__(self):
     Probe.__init__(self)
コード例 #11
0
ファイル: wfs.py プロジェクト: geopython/GeoHealthCheck
 def __init__(self):
     Probe.__init__(self)
     self.layer_count = 0