Coverage for app/backend/src/tests/test_gis.py: 100%
29 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-19 15:47 +0000
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-19 15:47 +0000
1import json
3from google.protobuf import empty_pb2
5from couchers.materialized_views import refresh_materialized_views, refresh_materialized_views_rapid
6from tests.fixtures.db import generate_user
7from tests.fixtures.sessions import gis_session
8from tests.test_communities import testing_communities # noqa
11class TestGIS:
12 @staticmethod
13 def test_GetUsers(testing_communities):
14 _, token = generate_user()
16 refresh_materialized_views_rapid(empty_pb2.Empty())
18 with gis_session(token) as gis:
19 http_body = gis.GetUsers(empty_pb2.Empty())
20 assert http_body.content_type == "application/json"
21 data = json.loads(http_body.data)
22 print(data)
23 assert data["type"] == "FeatureCollection"
24 assert len(data["features"]) > 1
26 @staticmethod
27 def test_GetClusteredUsers(testing_communities):
28 _, token = generate_user()
30 refresh_materialized_views(empty_pb2.Empty())
32 with gis_session(token) as gis:
33 http_body = gis.GetClusteredUsers(empty_pb2.Empty())
34 assert http_body.content_type == "application/json"
35 data = json.loads(http_body.data)
36 print(data)
37 assert data["type"] == "FeatureCollection"
38 assert len(data["features"]) > 1