Ejemplo n.º 1
0
class TestNetwork(unittest.TestCase):
    def setUp(self):
        self.graph = Graph(file=None, contents=GRAPH)

    def test_simple(self):
        for i in range(32):
            self.graph.allocate(1, 3)
Ejemplo n.º 2
0
class TestAlgorithm(unittest.TestCase):
    def setUp(self):
        self.wavelengths = 4
        self.graph = Graph(file=None, contents=GRAPH_ALGO, wl=self.wavelengths)

    def test_first_fit_saturation(self):
        """
        This test try to allocate all the wavelengths on the link 4, 5
        and then check if that an extra allocation result in a block
        """

        for i in xrange(self.wavelengths):
            self.graph.allocate(1, 5)

        self.assertTrue(self.graph.allocate(4, 5) is None)
Ejemplo n.º 3
0
 def setUp(self):
     self.graph = Graph(file=None, contents=GRAPH)
Ejemplo n.º 4
0
 def setUp(self):
     self.wavelengths = 4
     self.graph = Graph(file=None, contents=GRAPH_ALGO, wl=self.wavelengths)