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')
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')
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")
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")