Browse Source

add test data

tags/1.4.4
Etienne Trimaille 3 years ago
parent
commit
b9d3ecf5d6
4 changed files with 123577 additions and 0 deletions
  1. 0
    0
      core/parser/test/__init__.py
  2. 89
    0
      test/data/no_metadata.osm
  3. 123468
    0
      test/data/town-metadata.osm
  4. 20
    0
      test/utilities.py

+ 0
- 0
core/parser/test/__init__.py View File


+ 89
- 0
test/data/no_metadata.osm View File

@@ -0,0 +1,89 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<osm version="0.6" generator="Overpass API">
3
+<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
4
+<meta osm_base="2015-10-19T14:46:02Z"/>
5
+
6
+  <node id="3777334159" lat="45.7849384" lon="4.9998369">
7
+    <tag k="emergency" v="fire_hydrant"/>
8
+    <tag k="fire_hydrant:position" v="sidewalk"/>
9
+    <tag k="fire_hydrant:type" v="pillar"/>
10
+    <tag k="ref" v="13725"/>
11
+  </node>
12
+  <node id="3777435958" lat="45.7808696" lon="5.0000452">
13
+    <tag k="emergency" v="fire_hydrant"/>
14
+    <tag k="fire_hydrant:count" v="3"/>
15
+    <tag k="fire_hydrant:position" v="sidewalk"/>
16
+    <tag k="fire_hydrant:type" v="pillar"/>
17
+    <tag k="ref" v="5535"/>
18
+  </node>
19
+  <node id="3777439858" lat="45.7829257" lon="4.9990890">
20
+    <tag k="emergency" v="fire_hydrant"/>
21
+    <tag k="fire_hydrant:count" v="3"/>
22
+    <tag k="fire_hydrant:position" v="sidewalk"/>
23
+    <tag k="fire_hydrant:type" v="pillar"/>
24
+    <tag k="ref" v="5536"/>
25
+  </node>
26
+  <node id="3777914634" lat="45.7847061" lon="5.0005261">
27
+    <tag k="emergency" v="fire_hydrant"/>
28
+    <tag k="fire_hydrant:position" v="sidewalk"/>
29
+    <tag k="fire_hydrant:type" v="pillar"/>
30
+    <tag k="ref" v="14419"/>
31
+  </node>
32
+  <node id="3778381966" lat="45.7854432" lon="5.0013583">
33
+    <tag k="emergency" v="fire_hydrant"/>
34
+    <tag k="fire_hydrant:position" v="sidewalk"/>
35
+    <tag k="fire_hydrant:type" v="pillar"/>
36
+    <tag k="ref" v="13723"/>
37
+  </node>
38
+  <node id="3778418558" lat="45.7851798" lon="5.0022340">
39
+    <tag k="emergency" v="fire_hydrant"/>
40
+    <tag k="fire_hydrant:position" v="green"/>
41
+    <tag k="fire_hydrant:type" v="pillar"/>
42
+    <tag k="ref" v="14120"/>
43
+  </node>
44
+  <node id="3778427784" lat="45.7850451" lon="5.0045106">
45
+    <tag k="emergency" v="fire_hydrant"/>
46
+    <tag k="fire_hydrant:position" v="sidewalk"/>
47
+    <tag k="fire_hydrant:type" v="pillar"/>
48
+  </node>
49
+  <node id="3778428068" lat="45.7813562" lon="5.0023197">
50
+    <tag k="emergency" v="fire_hydrant"/>
51
+    <tag k="fire_hydrant:count" v="3"/>
52
+    <tag k="fire_hydrant:position" v="sidewalk"/>
53
+    <tag k="fire_hydrant:type" v="pillar"/>
54
+    <tag k="ref" v="5607"/>
55
+  </node>
56
+  <node id="3778428171" lat="45.7821032" lon="5.0054256">
57
+    <tag k="emergency" v="fire_hydrant"/>
58
+    <tag k="fire_hydrant:position" v="sidewalk"/>
59
+    <tag k="fire_hydrant:type" v="pillar"/>
60
+    <tag k="ref" v="5534"/>
61
+  </node>
62
+  <node id="3778436918" lat="45.7817920" lon="5.0001067">
63
+    <tag k="emergency" v="fire_hydrant"/>
64
+    <tag k="fire_hydrant:count" v="3"/>
65
+    <tag k="fire_hydrant:position" v="sidewalk"/>
66
+    <tag k="fire_hydrant:type" v="pillar"/>
67
+    <tag k="ref" v="7441"/>
68
+  </node>
69
+  <node id="3778443957" lat="45.7832462" lon="5.0048516">
70
+    <tag k="emergency" v="fire_hydrant"/>
71
+    <tag k="fire_hydrant:position" v="green"/>
72
+    <tag k="fire_hydrant:type" v="pillar"/>
73
+    <tag k="ref" v="11318"/>
74
+  </node>
75
+  <node id="3778450257" lat="45.7818184" lon="5.0052596">
76
+    <tag k="emergency" v="fire_hydrant"/>
77
+    <tag k="fire_hydrant:position" v="sidewalk"/>
78
+    <tag k="fire_hydrant:type" v="pillar"/>
79
+    <tag k="ref" v="8291"/>
80
+  </node>
81
+  <node id="3778455961" lat="45.7824337" lon="4.9999679">
82
+    <tag k="emergency" v="fire_hydrant"/>
83
+    <tag k="fire_hydrant:count" v="3"/>
84
+    <tag k="fire_hydrant:position" v="sidewalk"/>
85
+    <tag k="fire_hydrant:type" v="pillar"/>
86
+    <tag k="ref" v="4982"/>
87
+  </node>
88
+
89
+</osm>

+ 123468
- 0
test/data/town-metadata.osm
File diff suppressed because it is too large
View File


+ 20
- 0
test/utilities.py View File

@@ -3,6 +3,7 @@
3 3
 
4 4
 import sys
5 5
 import logging
6
+from os.path import dirname, abspath, join
6 7
 
7 8
 LOGGER = logging.getLogger('QGIS')
8 9
 QGIS_APP = None  # Static variable used to hold hand to running QGIS app
@@ -11,6 +12,25 @@ IFACE = None
11 12
 PARENT = None
12 13
 
13 14
 
15
+def test_data_path(*args):
16
+    """Return the absolute path to the QuickOSM test data or directory path.
17
+
18
+    :param args: List of path e.g. ['control', 'files',
19
+        'test-error-message.txt'] or ['control', 'scenarios'] to get the path
20
+        to scenarios dir.
21
+    :type args: list
22
+
23
+    :return: Absolute path to the test data or dir path.
24
+    :rtype: str
25
+    """
26
+    path = dirname(__file__)
27
+    path = abspath(join(path, 'data'))
28
+    for item in args:
29
+        path = abspath(join(path, item))
30
+
31
+    return path
32
+
33
+
14 34
 def get_qgis_app():
15 35
     """ Start one QGIS application to test against.
16 36
 

Loading…
Cancel
Save