Changeset c7fb59c in osmose-backend


Ignore:
Timestamp:
Nov 10, 2014 7:12:02 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
22f2524
Parents:
c74cbbd
Message:

Add test on Plugin.availableMethodes()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/Plugin.py

    r48057aa rc7fb59c  
    233233        self.assertEquals(self.check_str(u"éééé", None), None) 
    234234        assert_raises(Exception, self.check_str, "ééé", None) 
     235 
     236    def test_availableMethodes(self): 
     237        class Plugin_with_node(Plugin): 
     238            def node(self, node, tags): 
     239                pass 
     240        a = Plugin_with_node(None) 
     241        self.assertEquals(a.availableMethodes(), ["node"]) 
     242 
     243        class Plugin_with_way(Plugin): 
     244            def way(self, node, tags, nodes): 
     245                pass 
     246        a = Plugin_with_way(None) 
     247        self.assertEquals(a.availableMethodes(), ["way"]) 
     248 
     249        class Plugin_with_relation(Plugin): 
     250            def relation(self, relation, tags, members): 
     251                pass 
     252        a = Plugin_with_relation(None) 
     253        self.assertEquals(a.availableMethodes(), ["relation"]) 
     254 
     255        class Plugin_with_all(Plugin_with_node, Plugin_with_way, Plugin_with_relation): 
     256            pass 
     257        a = Plugin_with_all(None) 
     258        self.assertEquals(a.availableMethodes(), ["node", "way", "relation"]) 
Note: See TracChangeset for help on using the changeset viewer.