예제 #1
0
 def test_relation_with_tags(self):
     self._run_file(
         create_osm_file([
             osmobj('R',
                    id=1,
                    members=[('W', 1, '')],
                    tags=dict(foo='bar', name='xx'))
         ]))
예제 #2
0
 def test_way_with_tags(self):
     self._run_file(
         create_osm_file([
             osmobj('W',
                    id=1,
                    nodes=[1, 2, 3],
                    tags=dict(foo='bar', name='xx'))
         ]))
예제 #3
0
 def test_file_header(self):
     fn = create_osm_file([osmobj('N', id=1)])
     try:
         rd = o.io.Reader(fn)
         h = rd.header()
         assert_false(h.has_multiple_object_versions)
         rd.close()
     finally:
         os.remove(fn)
예제 #4
0
 def test_broken_timestamp(self):
     fn = create_osm_file([osmobj('N', id=1, timestamp='x')])
     try:
         rd = o.io.Reader(fn)
         with assert_raises(ValueError):
             o.apply(rd, o.SimpleHandler())
         rd.close()
     finally:
         os.remove(fn)
예제 #5
0
 def test_file_header(self):
     fn = create_osm_file([osmobj('N', id=1)])
     try:
         rd = o.io.Reader(fn)
         h = rd.header()
         assert_false(h.has_multiple_object_versions)
         rd.close()
     finally:
         os.remove(fn)
예제 #6
0
 def test_broken_timestamp(self):
     fn = create_osm_file([osmobj('N', id=1, timestamp='x')])
     try:
         rd = o.io.Reader(fn)
         with assert_raises(ValueError):
             o.apply(rd, o.SimpleHandler())
         rd.close()
     finally:
         os.remove(fn)
예제 #7
0
 def test_node_with_tags(self):
     self._run_file(
         create_osm_file(
             [osmobj('N', id=1, tags=dict(foo='bar', name='xx'))]))
예제 #8
0
 def test_relation_only(self):
     self._run_file(
         create_osm_file([osmobj('R', id=1, members=[('W', 1, '')])]))
예제 #9
0
 def test_way_only(self):
     self._run_file(create_osm_file([osmobj('W', id=1, nodes=[1, 2, 3])]))
예제 #10
0
 def test_node_only(self):
     self._run_file(create_osm_file([osmobj('N', id=1)]))
예제 #11
0
 def test_relation_with_tags(self):
     self._run_file(create_osm_file([osmobj('R', id=1, members=[('W', 1, '')],
                                            tags=dict(foo='bar', name='xx'))]))
예제 #12
0
 def test_way_with_tags(self):
     self._run_file(create_osm_file([osmobj('W', id=1, nodes=[1,2,3],
                                            tags=dict(foo='bar', name='xx'))]))
예제 #13
0
 def test_node_with_tags(self):
     self._run_file(create_osm_file([osmobj('N', id=1, 
                                            tags=dict(foo='bar', name='xx'))]))
예제 #14
0
 def test_relation_only(self):
     self._run_file(create_osm_file([osmobj('R', id=1, members=[('W', 1, '')])]))
예제 #15
0
 def test_way_only(self):
     self._run_file(create_osm_file([osmobj('W', id=1, nodes=[1,2,3])]))
예제 #16
0
 def test_node_only(self):
     self._run_file(create_osm_file([osmobj('N', id=1)]))