diff --git a/tests/test_systems_catalog.py b/tests/test_systems_catalog.py index f24808f3..eee75069 100644 --- a/tests/test_systems_catalog.py +++ b/tests/test_systems_catalog.py @@ -40,4 +40,24 @@ class TestSystemsCatalog(TestCase): def test_north_america_systems_catalog(self): catalog = EnergySystemsCatalogFactory('north_america').catalog + catalog_categories = catalog.names() + archetypes = catalog.names('archetypes') + self.assertEqual(6, len(archetypes['archetypes'])) + systems = catalog.names('systems') + self.assertEqual(7, len(systems['systems'])) + generation_equipments = catalog.names('generation_equipments') + self.assertEqual(21, len(generation_equipments['generation_equipments'])) + storage_equipments = catalog.names('storage_equipments') + self.assertEqual(6, len(storage_equipments['storage_equipments'])) + with self.assertRaises(ValueError): + catalog.names('unknown') + + # retrieving all the entries should not raise any exceptions + for category in catalog_categories: + for value in catalog_categories[category]: + catalog.get_entry(value) + print(catalog.entries()) + + with self.assertRaises(IndexError): + catalog.get_entry('unknown')