コード例 #1
0
    def test_existing_yaml(self):
        from malcolm.modules.demo.blocks import hello_block

        controllers = hello_block(mri="h")
        assert len(controllers) == 1
        assert isinstance(controllers[0], BasicController)
        assert len(controllers[0].parts) == 1
コード例 #2
0
 def setUp(self):
     self.process = Process("proc")
     self.hello = hello_block(mri="hello")[-1]
     self.process.add_controller(self.hello)
     self.server = web_server_block(mri="server", port=self.socket)[-1]
     self.process.add_controller(self.server)
     self.result = Queue()
     self.process.start()
コード例 #3
0
ファイル: test_pva_server.py プロジェクト: hir12111/pymalcolm
 def setUp(self):
     TestPVAServer.SEQ += 1
     self.process = Process("proc%s" % TestPVAServer.SEQ)
     self.hello = hello_block(mri="TESTHELLO")[-1]
     self.process.add_controller(self.hello)
     self.counter = counter_block(mri="TESTCOUNTER")[-1]
     self.process.add_controller(self.counter)
     self.server = pva_server_block(mri="PVA")[-1]
     self.process.add_controller(self.server)
     self.process.start()
     self.addCleanup(self.process.stop, timeout=2)
     self.ctxt = self.make_pva_context(unwrap=False)
コード例 #4
0
 def setUp(self):
     self.process = Process("proc")
     for controller in (hello_block(mri="hello") +
                        counter_block(mri="counter") +
                        web_server_block(mri="server", port=self.socket)):
         self.process.add_controller(controller)
     self.process.start()
     self.process2 = Process("proc2")
     for controller in (
             websocket_client_block(mri="client", port=self.socket) +
             proxy_block(mri="hello", comms="client") +
             proxy_block(mri="counter", comms="client")):
         self.process2.add_controller(controller)
     self.process2.start()
コード例 #5
0
ファイル: test_yamlutil.py プロジェクト: nsob1c12/pymalcolm
 def test_all_yamls(self):
     from malcolm.modules.demo.blocks import hello_block
     process = Mock()
     controller = hello_block(process, dict(mri="h"))
     assert isinstance(controller, BasicController)
     process.add_controller.assert_called_once_with("h", controller)
コード例 #6
0
 def setUp(self):
     self.p = Process("proc")
     for c in hello_block("mri"):
         self.p.add_controller(c)
     self.p.start()