Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and naschmitz committed Dec 17, 2024
1 parent 5badec4 commit 58ad7f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/fake_ee.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def filterBounds(self, *_, **__):

def geometry(self, *_, **__):
return Geometry.Polygon()

def aggregate_array(self, *_, **__):
return List(["aggregation-one", "aggregation-two"])

Expand Down Expand Up @@ -204,7 +204,7 @@ def __eq__(self, other: object):
featuresEqual = self.feature == getattr(other, "feature")
propertiesEqual = self.properties == getattr(other, "properties")
return featuresEqual and propertiesEqual

def propertyNames(self, *_, **__):
return List(["prop-1", "prop-2"])

Expand Down
4 changes: 2 additions & 2 deletions tests/fake_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def click(self, coordinates, event_type):

def get_scale(self):
return self.scale

@property
def bounds(self):
return ((1, 2), (3, 4))
Expand Down Expand Up @@ -180,7 +180,7 @@ def __init__(self, name="test-layer", visible=True, opacity=1.0):

def observe(self, func, names):
pass

def calculate_vis_minmax(
self,
*,
Expand Down
5 changes: 2 additions & 3 deletions tests/test_map_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,16 +834,15 @@ def test_layer_editor_handle_calculate_field_values(self):
"response": {"field-values": ["aggregation-one", "aggregation-two"]},
}
widget.send.assert_called_once_with(response)

def test_layer_editor_handle_close_click(self):
"""Tests that close click events are handled."""
on_close_mock = MagicMock()
widget = map_widgets.LayerEditor(
self._fake_map, self._fake_layer_dict(ee.FeatureCollection())
)
widget.on_close = on_close_mock
event = {'id': 'close', 'type': 'click'}
event = {"id": "close", "type": "click"}
widget._handle_message_event(None, event, None)

on_close_mock.assert_called_once_with()

0 comments on commit 58ad7f5

Please sign in to comment.