コード例 #1
0
ファイル: test_experiment.py プロジェクト: minhhaiphys/Auspex
    def test_run_simple_graph_branchout(self):
        exp = TestExperiment()
        printer1 = Print(name="One")
        printer2 = Print(name="Two")

        edges = [(exp.chan1, printer1.sink), (exp.chan1, printer2.sink)]

        exp.set_graph(edges)
        exp.run_sweeps()
コード例 #2
0
ファイル: test_experiment.py プロジェクト: minhhaiphys/Auspex
    def test_compressed_streams(self):
        exp = TestExperiment()
        printer1 = Print(name="One")
        printer2 = Print(name="Two")

        edges = [(exp.chan1, printer1.sink), (exp.chan1, printer2.sink)]

        exp.set_graph(edges)
        exp.set_stream_compression("zlib")
        exp.run_sweeps()
コード例 #3
0
    def test_create_graph(self):
        exp         = TestExperiment()
        printer_one = Print(name="One")
        printer_two = Print(name="Two")

        edges = [(exp.chan1, printer_one.sink),
                 (exp.chan2, printer_two.sink)]

        exp.set_graph(edges)

        self.assertTrue(exp.chan1.output_streams[0] == printer_one.sink.input_streams[0])
        self.assertTrue(exp.chan2.output_streams[0] == printer_two.sink.input_streams[0])
        self.assertTrue(len(exp.nodes) == 3)
        self.assertTrue(exp in exp.nodes)
        self.assertTrue(printer_one in exp.nodes)
コード例 #4
0
ファイル: test_experiment.py プロジェクト: minhhaiphys/Auspex
    def test_run_simple_graph(self):
        exp = TestExperiment()
        printer = Print()

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

        exp.set_graph(edges)
        exp.run_sweeps()
コード例 #5
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()
コード例 #6
0
ファイル: test_experiment.py プロジェクト: minhhaiphys/Auspex
    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)
コード例 #7
0
ファイル: test_experiment.py プロジェクト: minhhaiphys/Auspex
    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)