Ejemplo n.º 1
0
    def test_depth(self):
        exp         = TestExperiment()
        passthrough = Passthrough(name="Passthrough")
        printer     = Print(name="Printer")

        edges = [(exp.chan1, passthrough.sink), (passthrough.source, printer.sink)]

        exp.set_graph(edges)
        exp.run_sweeps()
Ejemplo n.º 2
0
    def test_update_descriptors(self):
        exp = TestExperiment()
        pt = Passthrough()
        prnt = Print(name="One")

        edges = [(exp.chan1, pt.sink), (pt.source, prnt.sink)]

        exp.set_graph(edges)
        exp.update_descriptors()
        self.assertFalse(pt.sink.descriptor is None)
        self.assertFalse(prnt.sink.descriptor is None)
        self.assertTrue(exp.chan1.descriptor == pt.sink.descriptor)
Ejemplo n.º 3
0
    def test_graph_parenting(self):
        exp = TestExperiment()
        pt = Passthrough()
        prnt = Print(name="One")

        edges = [(exp.chan1, pt.sink), (pt.source, prnt.sink)]

        exp.set_graph(edges)

        self.assertTrue(pt.source.parent == pt)
        self.assertTrue(exp.chan1.output_streams[0].end_connector.parent == pt)
        self.assertTrue(
            pt.source.output_streams[0].end_connector.parent == prnt)