示例#1
0
 def test_basic_depends_on(self):
     q = JobQueue(1)
     g = CommandGraph(q)
     q.set_command_graph(g)
     c1 = CommandNode("sleep 1", "1")
     c2 = CommandNode("echo hello", "2", stdout="test.txt")
     g.add_node(command_node=c1, depends_on=[c2])
     assert set(g.nodes()) == set(['1', '2'])
     g.start()
     g.finish_block()
     os.remove('test.txt')
示例#2
0
 def test_basic_depends_on(self):
     q = JobQueue(1)
     g = CommandGraph(q)
     q.set_command_graph(g)
     c1 = CommandNode("sleep 1", "1")
     c2 = CommandNode("echo hello", "2", stdout="test.txt") 
     g.add_node(command_node=c1, depends_on=[c2])
     assert set(g.nodes())== set(['1', '2'])
     g.start()
     g.finish_block()
     os.remove('test.txt')
示例#3
0
 def test_two_depends_on(self):
     q = JobQueue(1)
     g = CommandGraph(q)
     q.set_command_graph(g)
     c1 = CommandNode("sleep 1", "1")
     c2 = CommandNode("echo hello", "2", stdout="test.txt")
     c3 = CommandNode("echo hello", "3", stdout="test2.txt")
     g.add_node(command_node=c1, depends_on=[c3, c2])
     g.add_node(command_node=c3, depends_on=[c2])
     g.start()
     g.finish_block()
     os.remove("test.txt")
     os.remove("test2.txt")
示例#4
0
 def test_two_depends_on(self):
     q = JobQueue(1)
     g = CommandGraph(q)
     q.set_command_graph(g)
     c1 = CommandNode("sleep 1", "1")
     c2 = CommandNode("echo hello", "2", stdout="test.txt") 
     c3 = CommandNode("echo hello", "3", stdout="test2.txt") 
     g.add_node(command_node=c1, depends_on=[c3,c2])
     g.add_node(command_node=c3, depends_on=[c2])
     g.start()
     g.finish_block()
     os.remove("test.txt")
     os.remove("test2.txt")