def test_xml_read(self):
        generated_metadata = OutputLayerMetadata(EXISTING_IMPACT_FILE,
                                                 xml_uri=EXISTING_IMPACT_XML)

        # TODO (MB): add more checks
        self.assertEquals(generated_metadata.get_xml_value('license'), 'GPLv2')
 def test_invalid_json_read(self):
     with self.assertRaises(MetadataReadError):
         OutputLayerMetadata(EXISTING_IMPACT_FILE,
                             json_uri=INVALID_IMPACT_JSON)
 def test_incomplete_json_read(self):
     OutputLayerMetadata(EXISTING_IMPACT_FILE,
                         json_uri=INCOMPLETE_IMPACT_JSON)
    def test_json_read(self):
        metadata = OutputLayerMetadata(EXISTING_IMPACT_FILE)
        with open(EXISTING_IMPACT_JSON) as f:
            expected_metadata = f.read()

        self.assertEquals(expected_metadata, metadata.json)