Skip to content

Commit

Permalink
comment out exception raising on getting meters
Browse files Browse the repository at this point in the history
  • Loading branch information
nllong committed Feb 4, 2025
1 parent 6f857d1 commit 73ee903
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions tests/geojson/test_geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,24 @@ def test_get_building_properties_by_id(self):
building_properties = json.get_building_properties_by_id("5a72287837f4de77124f946a")
assert building_properties["floor_area"] == 24567

def test_get_meters_for_building(self):
filename = self.data_dir / "geojson_1.json"
json = UrbanOptGeoJson(filename)
with pytest.raises(KeyError, match="No meters found"):
json.get_meters_for_building("5a72287837f4de77124f946a")

def test_get_meter_readings_for_building(self):
filename = self.data_dir / "geojson_1.json"
json = UrbanOptGeoJson(filename)
with pytest.raises(KeyError, match="No meter readings found"):
json.get_meter_readings_for_building(building_id="5a72287837f4de77124f946a", meter_type="Electricity")

def test_get_monthly_readings(self):
filename = self.data_dir / "geojson_1.json"
json = UrbanOptGeoJson(filename)
with pytest.raises(KeyError, match="No monthly readings found"):
json.get_monthly_readings(building_id="5a72287837f4de77124f946a")
# These no longer throw exceptions, they just write to the log file.
# def test_get_meters_for_building(self):
# filename = self.data_dir / "geojson_1.json"
# json = UrbanOptGeoJson(filename)
# with pytest.raises(KeyError, match="No meters found"):
# json.get_meters_for_building("5a72287837f4de77124f946a")

# def test_get_meter_readings_for_building(self):
# filename = self.data_dir / "geojson_1.json"
# json = UrbanOptGeoJson(filename)
# with pytest.raises(KeyError, match="No meter readings found"):
# json.get_meter_readings_for_building(building_id="5a72287837f4de77124f946a", meter_type="Electricity")

# def test_get_monthly_readings(self):
# filename = self.data_dir / "geojson_1.json"
# json = UrbanOptGeoJson(filename)
# with pytest.raises(KeyError, match="No monthly readings found"):
# json.get_monthly_readings(building_id="5a72287837f4de77124f946a")

def test_set_property_on_building_id(self):
filename = self.data_dir / "geojson_1.json"
Expand Down

0 comments on commit 73ee903

Please sign in to comment.