コード例 #1
0
 def test_all_supporters(self):
     vmap = VerticesMap(None)
     a = Vertex('a', vmap)
     a.depends_on('b')
     b = vmap['b']
     b.depends_on('c')
     self.assertEqual(['b', 'c'], a.supporters(recurse=True))
コード例 #2
0
 def test_all_supporters(self):
     dag = DepDag()
     a = Vertex('a', dag)
     a.depends_on('b')
     b = dag['b']
     b.depends_on('c')
     self.assertEqual(['b', 'c'], names_list(a.all_supporters()))
コード例 #3
0
 def test_depends_on__test_supporters(self):
     vtx = Vertex('vertex_0', VerticesMap(None))
     vtx.depends_on('vertex_1', 'vertex_2')
     expected = ['vertex_1', 'vertex_2']
     self.assertEqual(expected, vtx.supporters(recurse=False))
     vtx.depends_on('vertex_2', 'vertex_3')
     expected = ['vertex_1', 'vertex_2', 'vertex_3']
     self.assertEqual(expected, vtx.supporters(recurse=False))
コード例 #4
0
 def test_depends_on__test_supporters(self):
     vertex = Vertex('vertex_0', DepDag())
     vertex.depends_on('vertex_1', 'vertex_2')
     expected = ['vertex_1', 'vertex_2']
     self.assertEqual(expected, names_list(vertex.direct_supporters()))
     vertex.depends_on('vertex_2', 'vertex_3')
     expected = ['vertex_1', 'vertex_2', 'vertex_3']
     self.assertEqual(expected, names_list(vertex.direct_supporters()))
コード例 #5
0
 def test_is_resolved__simplest_case(self):
     vmap = VerticesMap(None)
     a = Vertex('a', vmap)
     a.depends_on('b')
     self.assertFalse(a.is_resolved())
     b = vmap['b']
     self.assertFalse(b.is_resolved())
     b.payload = 'payload for vert-b'
     self.assertFalse(a.is_resolved())
     self.assertTrue(b.is_resolved())
     a.payload = 'payload for vert-a'
     self.assertTrue(a.is_resolved())
     self.assertTrue(b.is_resolved())
コード例 #6
0
 def test_is_resolved__simplest_case(self):
     dag = DepDag()
     a = Vertex('a', dag)
     a.depends_on('b')
     self.assertFalse(a.is_resolved())
     b = dag['b']
     self.assertFalse(b.is_resolved())
     b.payload = 'payload for vert-b'
     self.assertFalse(a.is_resolved())
     self.assertTrue(b.is_resolved())
     a.payload = 'payload for vert-a'
     self.assertTrue(a.is_resolved())
     self.assertTrue(b.is_resolved())