Skip to content

Commit

Permalink
call on_change from probe
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed Dec 1, 2024
1 parent a35ff96 commit 449d2ba
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions winforms/tests_backend/hardware/location.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from unittest.mock import Mock

from pytest import xfail

from toga.types import LatLng

from .hardware import HardwareProbe


Expand All @@ -24,8 +28,15 @@ def grant_permission(self):
def reject_permission(self):
xfail("No support for permissions here")

def add_location(self, location, altitude, cached=False):
pass
def add_location(self, location: LatLng, altitude, cached=False):
m = Mock()
m.Position = Mock()
m.Position.Location = Mock()
m.Position.Location.Latitude = location.lat
m.Position.Location.Longitude = location.lng
m.Position.Location.Altitude = altitude

self.app.location._impl._position_changed(None, m)

def allow_background_permission(self):
pass
Expand Down

0 comments on commit 449d2ba

Please sign in to comment.