def assertParseEquals(self, string, routes, **kwargs):
        f = StringIO.StringIO(string)
        net = RoutingTable.fromFile(f, **kwargs)
        f.close()

        expectednet = RoutingTable()
        for route in routes:
            expectednet.addSubnet(*route)
        self.assertEquals(list(iter(net)), list(iter(expectednet)))
    def assertParseEquals(self, string, routes, **kwargs):
        f = StringIO.StringIO(string)
        net = RoutingTable.fromFile(f, **kwargs)
        f.close()

        expectednet = RoutingTable()
        for route in routes:
            expectednet.addSubnet(*route)
        self.assertEquals(list(iter(net)),
                          list(iter(expectednet)))
    def assertRouteNamesOrder(self, string, routeNames):
        f = StringIO.StringIO(string)
        net = RoutingTable.fromFile(f)
        f.close()

        self.assertEquals(net.getRouteNames(), routeNames)
    def assertRouteNamesOrder(self, string, routeNames):
        f = StringIO.StringIO(string)
        net = RoutingTable.fromFile(f)
        f.close()

        self.assertEquals(net.getRouteNames(), routeNames)