def test_if_returning_iso_protocol_for_ds(self):
        with open('tests/test_data/iso-19115_ds.xml', 'r') as f:
            content = f.read()
        url = 'http://www.mapserver.com/some_iso'

        content = content.replace('\\n', '')
        parser = Parser(content)

        identifier = Identify([self.yaml_file], content, url, **{'parser': parser})
        identifier.identify()

        print identifier.to_json()

        self.assertTrue(identifier.protocol == 'ISO-19115 DS')
        self.assertTrue(identifier.version == 'ISO19115 2003/Cor.1:2006')
        self.assertTrue(identifier.has_metadata)
    def test_if_returning_iso_protocol_for_ds(self):
        with open('tests/test_data/iso-19115_ds.xml', 'r') as f:
            content = f.read()
        url = 'http://www.mapserver.com/some_iso'

        content = content.replace('\\n', '')
        parser = Parser(content)

        identifier = Identify([self.yaml_file], content, url,
                              **{'parser': parser})
        identifier.identify()

        print identifier.to_json()

        self.assertTrue(identifier.protocol == 'ISO-19115 DS')
        self.assertTrue(identifier.version == 'ISO19115 2003/Cor.1:2006')
        self.assertTrue(identifier.has_metadata)
    def test_rdf_language(self):
        with open(
                'tests/test_data/rdf_french_ed14b44e96042ad56c11cc0ca3768979.xml',
                'r') as f:
            content = f.read()
        url = 'http://catalog.data.gov/9bcffa1c-6164-4635-bc2c-6c98cce59d7b.rdf'

        content = content.replace('\\n', '')
        parser = Parser(content)

        identifier = Identify([
            'lib/configs/iso_identifier.yaml',
            'lib/configs/ogc_identifier.yaml',
            'lib/configs/oaipmh_identifier.yaml',
            'lib/configs/rdf_identifier.yaml'
        ], content, url, **{'parser': parser})
        identifier.identify()
        print identifier.to_json()
        self.assertTrue(identifier.protocol == 'RDF')
        self.assertTrue(identifier.language == 'fr')
    def test_rdf_language(self):
        with open('tests/test_data/rdf_french_ed14b44e96042ad56c11cc0ca3768979.xml', 'r') as f:
            content = f.read()
        url = 'http://catalog.data.gov/9bcffa1c-6164-4635-bc2c-6c98cce59d7b.rdf'

        content = content.replace('\\n', '')
        parser = Parser(content)

        identifier = Identify(
            [
                'lib/configs/iso_identifier.yaml',
                'lib/configs/ogc_identifier.yaml',
                'lib/configs/oaipmh_identifier.yaml',
                'lib/configs/rdf_identifier.yaml'
            ], content, url, **{'parser': parser}
        )
        identifier.identify()
        print identifier.to_json()
        self.assertTrue(identifier.protocol == 'RDF')
        self.assertTrue(identifier.language == 'fr')