<reponame>Macquaria/electricitymap-contrib
import unittest

from electricitymap.contrib.config import ZONES_CONFIG

ZONE_KEYS = ZONES_CONFIG.keys()


class ZonesJsonTestcase(unittest.TestCase):
    def test_bounding_boxes(self):
        for zone, values in ZONES_CONFIG.items():
            bbox = values.get("bounding_box")
            if bbox:
                self.assertLess(bbox[0][0], bbox[1][0])
                self.assertLess(bbox[0][1], bbox[1][1])

    def test_sub_zones(self):
        for zone, values in ZONES_CONFIG.items():
            sub_zones = values.get("subZoneNames", [])
            for sub_zone in sub_zones:
                self.assertIn(sub_zone, ZONE_KEYS)


if __name__ == "__main__":
    unittest.main(buffer=True)

import unittest

from electricitymap.contrib.config import ZONES_CONFIG

ZONE_KEYS = ZONES_CONFIG.keys()


class ZonesJsonTestcase(unittest.TestCase):
    def test_bounding_boxes(self):
        for zone, values in ZONES_CONFIG.items():
            bbox = values.get("bounding_box")
            if bbox:
                self.assertLess(bbox[0][0], bbox[1][0])
                self.assertLess(bbox[0][1], bbox[1][1])

    def test_sub_zones(self):
        for zone, values in ZONES_CONFIG.items():
            sub_zones = values.get("subZoneNames", [])
            for sub_zone in sub_zones:
                self.assertIn(sub_zone, ZONE_KEYS)


if __name__ == "__main__":
    unittest.main(buffer=True)