Skip to content
Snippets Groups Projects
test_gml_format.py 600 B
Newer Older
  • Learn to ignore specific revisions
  • Jesper Zedlitz's avatar
    Jesper Zedlitz committed
    import unittest
    from formats.gml_format import is_valid
    
    
    class TestGmlFormat(unittest.TestCase):
        def test_is_valid__valid(self):
            resource = {}
            with open("tests/data/bermuda.gml", "r") as file:
                self.assertTrue(is_valid(resource, file))
    
                self.assertIsNone(resource.get("error"))
    
    Jesper Zedlitz's avatar
    Jesper Zedlitz committed
    
        def test_is_valid__invalid(self):
            resource = {}
            with open("tests/data/correct.xml", "r") as file:
                self.assertFalse(is_valid(resource, file))
    
                self.assertIsNotNone(resource.get("error"))
    
    Jesper Zedlitz's avatar
    Jesper Zedlitz committed
    
    
    if __name__ == "__main__":
        unittest.main()