diff --git a/python/jsbsim.pyx.in b/python/jsbsim.pyx.in index b166ff7889..7f1ab8a4fc 100644 --- a/python/jsbsim.pyx.in +++ b/python/jsbsim.pyx.in @@ -523,19 +523,11 @@ cdef class FGFDMExec(FGJSBBase): def query_property_catalog(self, check): """@Dox(JSBSim::FGFDMExec::QueryPropertyCatalog)""" - catalog = (self.thisptr.QueryPropertyCatalog(check.encode())).decode('utf-8').rstrip().split('\n') - if len(catalog) == 1 and catalog[0] == "No matches found": - return [] - else: - return catalog - - def get_property_catalog(self, check): - """Retrieves the property catalog as a dictionary.""" - catalog = {} - for item in self.query_property_catalog(check): - property_name = item.split(" ")[0] # remove any (RW) flags - catalog[property_name] = self.get_property_value(property_name) - return catalog + return (self.thisptr.QueryPropertyCatalog(check.encode())).decode('utf-8') + + def get_property_catalog(self): + """Retrieves the property catalog as a list.""" + return self.query_property_catalog('').rstrip().split('\n') def print_property_catalog(self): """@Dox(JSBSim::FGFDMExec::PrintPropertyCatalog)""" diff --git a/tests/TestMiscellaneous.py b/tests/TestMiscellaneous.py index 3c585adb9e..9998d97474 100644 --- a/tests/TestMiscellaneous.py +++ b/tests/TestMiscellaneous.py @@ -55,15 +55,14 @@ def test_property_catalog(self): fdm.run_ic() catalog = fdm.query_property_catalog('geod-deg') - self.assertEqual(len(catalog), 2) - self.assertEqual(catalog[0], 'position/lat-geod-deg (R)') - self.assertEqual(catalog[1], 'ic/lat-geod-deg (RW)') - - values = fdm.get_property_catalog('geod-deg') - item = 'position/lat-geod-deg' - self.assertEqual(values[item], fdm[item]) - item = 'ic/lat-geod-deg' - self.assertEqual(values[item], fdm[item]) + self.assertIsInstance(catalog, str) + self.assertEqual(catalog, 'position/lat-geod-deg (R)\nic/lat-geod-deg (RW)\n') + + catalog = fdm.get_property_catalog() + self.assertIsInstance(catalog, list) + self.assertGreater(len(catalog), 2) + self.assertIn('position/lat-geod-deg (R)', catalog) + self.assertIn('ic/lat-geod-deg (RW)', catalog) def test_FG_reset(self): # This test reproduces how FlightGear resets. The important thing is