@@ -0,0 +1,3819 @@
+# Ariane CLI Python 3%0A# routing area acceptance tests%0A#%0A# Copyright (C) 2015 echinopsii%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as%0A# published by the Free Software Foundation, either version 3 of the%0A# License, or (at your option) any later version.%0A#%0A# This program is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU Affero General Public License for more details.%0A#%0A# You should have received a copy of the GNU Affero General Public License%0A# along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0Aimport unittest%0Afrom ariane_clip3.directory import DirectoryService, RoutingArea%0A%0A__author__ = 'mffrench'%0A%0A%0Aclass RoutingAreaTest(unittest.TestCase):%0A%0A    def test_new_routing_area(self):%0A        args = %7B'type': 'REST', 'base_url': 'http://localhost:6969/ariane/', 'user': 'yoda', 'password': 'secret'%7D%0A        service = DirectoryService(args)%0A        new_routing_area = RoutingArea(requester=service.routing_area_service.requester,%0A                                       name='my_new_routing_area',%0A                                       description='my new routing area',%0A                                       type=RoutingArea.RA_TYPE_LAN,%0A                                       multicast=RoutingArea.RA_MULTICAST_NOLIMIT)%0A        new_routing_area.save()%0A        self.assertIsNotNone(new_routing_area.id)%0A%0A    def test_remove_routing_area_by_name(self):%0A        args = %7B'type': 'REST', 'base_url': 'http://localhost:6969/ariane/', 'user': 'yoda', 'password': 'secret'%7D%0A        service = DirectoryService(args)%0A        rm_routing_area = service.routing_area_service.find_routing_area(ra_name=%22my_new_routing_area%22)%0A        if rm_routing_area is None:%0A            rm_routing_area = RoutingArea(requester=service.routing_area_service.requester,%0A                                          name='my_new_routing_area',%0A                                          description='my new routing area',%0A                                          type=RoutingArea.RA_TYPE_LAN,%0A                                          multicast=RoutingArea.RA_MULTICAST_NOLIMIT)%0A            rm_routing_area.save()%0A        self.assertIsNone(rm_routing_area.remove())%0A%0A    def test_routing_area_get(self):%0A        args = %7B'type': 'REST', 'base_url': 'http://localhost:6969/ariane/', 'user': 'yoda', 'password': 'secret'%7D%0A        service = DirectoryService(args)%0A        new_routing_area = RoutingArea(requester=service.routing_area_service.requester,%0A                                       name='my_new_routing_area',%0A                                       description='my new routing area',%0A                                       type=RoutingArea.RA_TYPE_LAN,%0A                                       multicast=RoutingArea.RA_MULTICAST_NOLIMIT)%0A        new_routing_area.save()%0A        ret = service.routing_area_service.get_routing_areas()%0A        self.assertGreaterEqual(ret.__len__(), 1)%0A%0A    def test_routing_area_find(self):%0A        args = %7B'type': 'REST', 'base_url': 'http://localhost:6969/ariane/', 'user': 'yoda', 'password': 'secret'%7D%0A        service = DirectoryService(args)%0A        new_routing_area = RoutingArea(requester=service.routing_area_service.requester,%0A                                       name='my_new_routing_area',%0A                                       description='my new routing area',%0A                                       type=RoutingArea.RA_TYPE_LAN,%0A                                       multicast=RoutingArea.RA_MULTICAST_NOLIMIT)%0A        new_routing_area.save()%0A        self.assertIsNotNone(service.routing_area_service.find_routing_area(ra_name=%22my_new_routing_area%22))

add routing area