umap-project 2.1.2__py3-none-any.whl → 2.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/models.py +2 -0
- umap/static/umap/js/umap.controls.js +29 -0
- umap/static/umap/js/umap.features.js +3 -1
- umap/static/umap/js/umap.importer.js +4 -5
- umap/static/umap/js/umap.js +27 -36
- umap/static/umap/js/umap.layer.js +7 -6
- umap/static/umap/test/Map.js +0 -304
- umap/static/umap/test/Polygon.js +0 -256
- umap/static/umap/test/Polyline.js +0 -116
- umap/static/umap/test/index.html +1 -4
- umap/tests/conftest.py +9 -0
- umap/tests/fixtures/test_upload_data.csv +2 -1
- umap/tests/fixtures/test_upload_data.umap +171 -0
- umap/tests/fixtures/test_upload_data_osm.json +33 -0
- umap/tests/integration/conftest.py +5 -0
- umap/tests/integration/test_anonymous_owned_map.py +3 -0
- umap/tests/integration/test_browser.py +4 -11
- umap/tests/integration/test_choropleth.py +89 -0
- umap/tests/integration/test_collaborative_editing.py +30 -1
- umap/tests/integration/test_datalayer.py +130 -0
- umap/tests/integration/test_edit_datalayer.py +134 -0
- umap/tests/integration/test_edit_map.py +15 -0
- umap/tests/integration/test_facets_browser.py +31 -0
- umap/tests/integration/test_import.py +347 -2
- umap/tests/integration/test_map.py +17 -37
- umap/tests/integration/test_owned_map.py +18 -0
- umap/tests/integration/test_picto.py +20 -33
- umap/tests/integration/test_polygon.py +363 -0
- umap/tests/integration/test_polyline.py +325 -0
- umap/tests/integration/test_tableeditor.py +27 -0
- {umap_project-2.1.2.dist-info → umap_project-2.1.3.dist-info}/METADATA +4 -4
- {umap_project-2.1.2.dist-info → umap_project-2.1.3.dist-info}/RECORD +36 -33
- umap/static/umap/test/Choropleth.js +0 -245
- umap/static/umap/test/DataLayer.js +0 -463
- umap/static/umap/test/Permissions.js +0 -74
- umap/static/umap/test/TableEditor.js +0 -104
- umap/tests/integration/test_drawing.py +0 -243
- {umap_project-2.1.2.dist-info → umap_project-2.1.3.dist-info}/WHEEL +0 -0
- {umap_project-2.1.2.dist-info → umap_project-2.1.3.dist-info}/entry_points.txt +0 -0
- {umap_project-2.1.2.dist-info → umap_project-2.1.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
from playwright.sync_api import expect
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_draw_polyline(page, live_server, tilelayer):
|
|
5
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
6
|
-
|
|
7
|
-
# Click on the Draw a line button on a new map.
|
|
8
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
9
|
-
"Draw a polyline"
|
|
10
|
-
)
|
|
11
|
-
create_line.click()
|
|
12
|
-
|
|
13
|
-
# Check no line is present by default.
|
|
14
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
15
|
-
# around
|
|
16
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
17
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
18
|
-
expect(lines).to_have_count(0)
|
|
19
|
-
expect(guide).to_have_count(0)
|
|
20
|
-
|
|
21
|
-
# Click on the map, it will create a line.
|
|
22
|
-
map = page.locator("#map")
|
|
23
|
-
map.click(position={"x": 200, "y": 200})
|
|
24
|
-
expect(lines).to_have_count(1)
|
|
25
|
-
expect(guide).to_have_count(1)
|
|
26
|
-
map.click(position={"x": 100, "y": 200})
|
|
27
|
-
expect(lines).to_have_count(1)
|
|
28
|
-
expect(guide).to_have_count(1)
|
|
29
|
-
map.click(position={"x": 100, "y": 100})
|
|
30
|
-
expect(lines).to_have_count(1)
|
|
31
|
-
expect(guide).to_have_count(1)
|
|
32
|
-
# Click again to finish
|
|
33
|
-
map.click(position={"x": 100, "y": 100})
|
|
34
|
-
expect(lines).to_have_count(1)
|
|
35
|
-
expect(guide).to_have_count(0)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def test_clicking_esc_should_finish_line(page, live_server, tilelayer):
|
|
39
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
40
|
-
|
|
41
|
-
# Click on the Draw a line button on a new map.
|
|
42
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
43
|
-
"Draw a polyline"
|
|
44
|
-
)
|
|
45
|
-
create_line.click()
|
|
46
|
-
|
|
47
|
-
# Check no line is present by default.
|
|
48
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
49
|
-
# around
|
|
50
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
51
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
52
|
-
expect(lines).to_have_count(0)
|
|
53
|
-
expect(guide).to_have_count(0)
|
|
54
|
-
|
|
55
|
-
# Click on the map, it will create a line.
|
|
56
|
-
map = page.locator("#map")
|
|
57
|
-
map.click(position={"x": 200, "y": 200})
|
|
58
|
-
expect(lines).to_have_count(1)
|
|
59
|
-
expect(guide).to_have_count(1)
|
|
60
|
-
map.click(position={"x": 100, "y": 200})
|
|
61
|
-
expect(lines).to_have_count(1)
|
|
62
|
-
expect(guide).to_have_count(1)
|
|
63
|
-
map.click(position={"x": 100, "y": 100})
|
|
64
|
-
expect(lines).to_have_count(1)
|
|
65
|
-
expect(guide).to_have_count(1)
|
|
66
|
-
# Click ESC to finish
|
|
67
|
-
page.keyboard.press("Escape")
|
|
68
|
-
expect(lines).to_have_count(1)
|
|
69
|
-
expect(guide).to_have_count(0)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def test_clicking_esc_should_delete_line_if_empty(page, live_server, tilelayer):
|
|
73
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
74
|
-
|
|
75
|
-
# Click on the Draw a line button on a new map.
|
|
76
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
77
|
-
"Draw a polyline"
|
|
78
|
-
)
|
|
79
|
-
create_line.click()
|
|
80
|
-
|
|
81
|
-
# Check no line is present by default.
|
|
82
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
83
|
-
# around
|
|
84
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
85
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
86
|
-
expect(lines).to_have_count(0)
|
|
87
|
-
expect(guide).to_have_count(0)
|
|
88
|
-
|
|
89
|
-
map = page.locator("#map")
|
|
90
|
-
map.click(position={"x": 200, "y": 200})
|
|
91
|
-
# At this stage, the line as one element, it should not be created
|
|
92
|
-
# on pressing esc, as invalid
|
|
93
|
-
# Click ESC to finish
|
|
94
|
-
page.keyboard.press("Escape")
|
|
95
|
-
expect(lines).to_have_count(0)
|
|
96
|
-
expect(guide).to_have_count(0)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def test_clicking_esc_should_delete_line_if_invalid(page, live_server, tilelayer):
|
|
100
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
101
|
-
|
|
102
|
-
# Click on the Draw a line button on a new map.
|
|
103
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
104
|
-
"Draw a polyline"
|
|
105
|
-
)
|
|
106
|
-
create_line.click()
|
|
107
|
-
|
|
108
|
-
# Check no line is present by default.
|
|
109
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
110
|
-
# around
|
|
111
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
112
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
113
|
-
expect(lines).to_have_count(0)
|
|
114
|
-
expect(guide).to_have_count(0)
|
|
115
|
-
|
|
116
|
-
# At this stage, the line as no element, it should not be created
|
|
117
|
-
# on pressing esc
|
|
118
|
-
# Click ESC to finish
|
|
119
|
-
page.keyboard.press("Escape")
|
|
120
|
-
expect(lines).to_have_count(0)
|
|
121
|
-
expect(guide).to_have_count(0)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
def test_draw_polygon(page, live_server, tilelayer):
|
|
125
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
126
|
-
|
|
127
|
-
# Click on the Draw a polygon button on a new map.
|
|
128
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
129
|
-
"Draw a polygon"
|
|
130
|
-
)
|
|
131
|
-
create_line.click()
|
|
132
|
-
|
|
133
|
-
# Check no polygon is present by default.
|
|
134
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
135
|
-
# around
|
|
136
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
137
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
138
|
-
expect(lines).to_have_count(0)
|
|
139
|
-
expect(guide).to_have_count(0)
|
|
140
|
-
|
|
141
|
-
# Click on the map, it will create a polygon.
|
|
142
|
-
map = page.locator("#map")
|
|
143
|
-
map.click(position={"x": 200, "y": 200})
|
|
144
|
-
expect(lines).to_have_count(1)
|
|
145
|
-
expect(guide).to_have_count(1)
|
|
146
|
-
map.click(position={"x": 100, "y": 200})
|
|
147
|
-
expect(lines).to_have_count(1)
|
|
148
|
-
expect(guide).to_have_count(2)
|
|
149
|
-
map.click(position={"x": 100, "y": 100})
|
|
150
|
-
expect(lines).to_have_count(1)
|
|
151
|
-
expect(guide).to_have_count(2)
|
|
152
|
-
# Click again to finish
|
|
153
|
-
map.click(position={"x": 100, "y": 100})
|
|
154
|
-
expect(lines).to_have_count(1)
|
|
155
|
-
expect(guide).to_have_count(0)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def test_clicking_esc_should_finish_polygon(page, live_server, tilelayer):
|
|
159
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
160
|
-
|
|
161
|
-
# Click on the Draw a polygon button on a new map.
|
|
162
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
163
|
-
"Draw a polygon"
|
|
164
|
-
)
|
|
165
|
-
create_line.click()
|
|
166
|
-
|
|
167
|
-
# Check no polygon is present by default.
|
|
168
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
169
|
-
# around
|
|
170
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
171
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
172
|
-
expect(lines).to_have_count(0)
|
|
173
|
-
expect(guide).to_have_count(0)
|
|
174
|
-
|
|
175
|
-
# Click on the map, it will create a polygon.
|
|
176
|
-
map = page.locator("#map")
|
|
177
|
-
map.click(position={"x": 200, "y": 200})
|
|
178
|
-
expect(lines).to_have_count(1)
|
|
179
|
-
expect(guide).to_have_count(1)
|
|
180
|
-
map.click(position={"x": 100, "y": 200})
|
|
181
|
-
expect(lines).to_have_count(1)
|
|
182
|
-
expect(guide).to_have_count(2)
|
|
183
|
-
map.click(position={"x": 100, "y": 100})
|
|
184
|
-
expect(lines).to_have_count(1)
|
|
185
|
-
expect(guide).to_have_count(2)
|
|
186
|
-
# Click ESC to finish
|
|
187
|
-
page.keyboard.press("Escape")
|
|
188
|
-
expect(lines).to_have_count(1)
|
|
189
|
-
expect(guide).to_have_count(0)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def test_clicking_esc_should_delete_polygon_if_empty(page, live_server, tilelayer):
|
|
193
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
194
|
-
|
|
195
|
-
# Click on the Draw a polygon button on a new map.
|
|
196
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
197
|
-
"Draw a polygon"
|
|
198
|
-
)
|
|
199
|
-
create_line.click()
|
|
200
|
-
|
|
201
|
-
# Check no polygon is present by default.
|
|
202
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
203
|
-
# around
|
|
204
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
205
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
206
|
-
expect(lines).to_have_count(0)
|
|
207
|
-
expect(guide).to_have_count(0)
|
|
208
|
-
|
|
209
|
-
# Click ESC to finish, no polygon should have been created
|
|
210
|
-
page.keyboard.press("Escape")
|
|
211
|
-
expect(lines).to_have_count(0)
|
|
212
|
-
expect(guide).to_have_count(0)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
def test_clicking_esc_should_delete_polygon_if_invalid(page, live_server, tilelayer):
|
|
216
|
-
page.goto(f"{live_server.url}/en/map/new/")
|
|
217
|
-
|
|
218
|
-
# Click on the Draw a polygon button on a new map.
|
|
219
|
-
create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
|
|
220
|
-
"Draw a polygon"
|
|
221
|
-
)
|
|
222
|
-
create_line.click()
|
|
223
|
-
|
|
224
|
-
# Check no polygon is present by default.
|
|
225
|
-
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
226
|
-
# around
|
|
227
|
-
lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
|
|
228
|
-
guide = page.locator(".leaflet-overlay-pane > svg > g > path")
|
|
229
|
-
expect(lines).to_have_count(0)
|
|
230
|
-
expect(guide).to_have_count(0)
|
|
231
|
-
|
|
232
|
-
# Click on the map twice, it will start a polygon.
|
|
233
|
-
map = page.locator("#map")
|
|
234
|
-
map.click(position={"x": 200, "y": 200})
|
|
235
|
-
expect(lines).to_have_count(1)
|
|
236
|
-
expect(guide).to_have_count(1)
|
|
237
|
-
map.click(position={"x": 100, "y": 200})
|
|
238
|
-
expect(lines).to_have_count(1)
|
|
239
|
-
expect(guide).to_have_count(2)
|
|
240
|
-
# Click ESC to finish, the polygon is invalid, it should not be persisted
|
|
241
|
-
page.keyboard.press("Escape")
|
|
242
|
-
expect(lines).to_have_count(0)
|
|
243
|
-
expect(guide).to_have_count(0)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|