def test_gsettings(): """GSettings should be storing data correctly""" Gst.reset('history') assert Gst.get('history')[0] == (34.5, 15.8, 2) MapView.set_zoom_level(2) MapView.center_on(12.3, 45.6) assert Gst.get_double('latitude') == 12.3 assert Gst.get_double('longitude') == 45.6 MapView.zoom_in() MapView.emit('realize') assert list(Gst.get('history')) == [(34.5, 15.8, 2), (12.3, 45.6, 3)]
def test_gsettings(): """GSettings should be storing data correctly""" Gst.reset("history") assert Gst.get("history")[0] == (34.5, 15.8, 2) MapView.set_zoom_level(2) MapView.center_on(12.3, 45.6) assert Gst.get_double("latitude") == 12.3 assert Gst.get_double("longitude") == 45.6 MapView.zoom_in() MapView.emit("realize") assert list(Gst.get("history")) == [(34.5, 15.8, 2), (12.3, 45.6, 3)]
def test_history(): """The history should keep track of where we go""" coords = [[MapView.get_center_latitude(), MapView.get_center_longitude()]] MapView.emit('realize') assert len(Widgets.main.get_title()) > 5 assert Widgets.main.get_title().index(',') > 0 lat = random_coord(90) lon = random_coord(180) MapView.center_on(lat, lon) coords.append([lat, lon]) assert coords[0][0] - Gst.get('history')[-1][0] < 1e-6 assert coords[0][1] - Gst.get('history')[-1][1] < 1e-6
def test_history(): """The history should keep track of where we go""" coords = [[ MapView.get_center_latitude(), MapView.get_center_longitude() ]] MapView.emit('realize') assert len(Widgets.main.get_title()) > 5 assert Widgets.main.get_title().index(',') > 0 lat = random_coord(90) lon = random_coord(180) MapView.center_on(lat, lon) coords.append([lat, lon]) assert coords[0][0] - Gst.get('history')[-1][0] < 1e-6 assert coords[0][1] - Gst.get('history')[-1][1] < 1e-6