More pipetool tests

This commit is contained in:
gpotter2 2017-05-08 23:24:12 +02:00
parent 59a7b9f69b
commit 1998f2f655
1 changed files with 46 additions and 0 deletions

View File

@ -19,3 +19,49 @@ p.graph(type="png",target="> /tmp/pipe.png")
p.start()
time.sleep(3)
p.stop()
= Test add_pipe
s = AutoSource()
p = PipeEngine(s)
p.add(Pipe())
assert len(p.active_pipes) == 2
x = p.spawn_Pipe()
assert len(p.active_pipes) == 3
assert isinstance(x, Pipe)
= Test Operators
s = AutoSource()
p = PipeEngine(s)
assert p == p
assert not p < p
assert not p > p
a = AutoSource()
b = AutoSource()
a >> b
assert len(a.high_sinks) == 1
assert len(a.high_sources) == 0
assert len(b.high_sinks) == 0
assert len(b.high_sources) == 1
a
b
a = AutoSource()
b = AutoSource()
a << b
assert len(a.high_sinks) == 0
assert len(a.high_sources) == 1
assert len(b.high_sinks) == 1
assert len(b.high_sources) == 0
a
b
= Test doc
s = AutoSource()
p = PipeEngine(s)
p.list_pipes()
p.list_pipes_detailed()