def test_reserve_maximum(self):
        man = TopologyManager(STEINER_NO_LOOP_CONFIG_FILE)

        # Get a tree connecting sw1, sw8, and sw6
        nodes = ['sw1', 'sw8', 'sw6']
        tree = man.find_valid_steiner_tree(nodes)

        # Should work
        man.reserve_bw_on_tree(tree, 80000000000)
    def test_unreserve_too_much(self):
        man = TopologyManager(STEINER_NO_LOOP_CONFIG_FILE)

        # Get a tree connecting sw1, sw8, and sw6
        nodes = ['sw1', 'sw8', 'sw6']
        tree = man.find_valid_steiner_tree(nodes)

        # Should work
        man.reserve_bw_on_tree(tree, 100)
        man.unreserve_bw_on_tree(tree, 100)

        self.failUnlessRaises(Exception, man.unreserve_bw_on_tree, tree, 100)

        man.reserve_bw_on_tree(tree, 100)
        self.failUnlessRaises(Exception, man.unreserve_bw_on_tree, tree, 200)