Changeset f8ca2c91 in osmose-backend


Ignore:
Timestamp:
Oct 28, 2014 10:49:58 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
5733da3
Parents:
c739f44
git-author:
Jocelyn Jaubert <jocelyn.jaubert@…> (28/10/2014 22:40:27)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (28/10/2014 22:49:58)
Message:

Add test to plugin TagFix_BadKey

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/TagFix_BadKey.py

    rc739f44 rf8ca2c91  
    6969    def relation(self, data, tags, members): 
    7070        return self.node(data, tags) 
     71 
     72########################################################################### 
     73from plugins.Plugin import TestPluginCommon 
     74 
     75class Test(TestPluginCommon): 
     76    def test(self): 
     77        a = TagFix_BadKey(None) 
     78        a.init(None) 
     79        for k in ["toto", "def9", "disused:amenity", "access:([date])", "def:a=b", 
     80                  "ISO3166-1", "ISO3166-1:alpha2"]: 
     81            assert not a.node(None, {k: 1}), ("key='%s'" % k) 
     82 
     83        for k in ["a-b", "a''b", u"é", u"û", "a=b"]: 
     84            self.check_err(a.node(None, {k: 1}), ("key='%s'" % k)) 
     85 
Note: See TracChangeset for help on using the changeset viewer.