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)
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)
def setUp(self): self.graph = Graph(file=None, contents=GRAPH)
def setUp(self): self.wavelengths = 4 self.graph = Graph(file=None, contents=GRAPH_ALGO, wl=self.wavelengths)