How to use the pvl.decoder.ParseError function in pvl

To help you get started, we’ve selected a few pvl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github planetarypy / planetaryimage / tests / test_mission_data.py View on Github external
def test_mission_data():
    data_products = PlanetaryTestDataProducts()

    for file_name in data_products.products:
        image_path = os.path.join(data_products.directory, file_name)
        try:
            image = PDS3Image.open(image_path)
            assert data_products.mission_data[file_name]['opens'] == "True"
            assert data_products.mission_data[file_name]['label'] \
                == image.label.items()[0][1]
        except (pvl.decoder.ParseError, KeyError, UnicodeDecodeError,
                ValueError):
            try:
                assert data_products.mission_data[file_name]['opens'] \
                    == "False"
            except:
                print (file_name, "is marked as True and should be false")
        except AssertionError:
            print (file_name, "is marked as False and should be True")

pvl

Python implementation for PVL (Parameter Value Language) parsing and encoding.

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages