コード例 #1
0
    def test_setup_ipc(self):
        address = "ipc:///tmp/nmos-nodefacade.dummy.for.test"
        UUT = Facade("dummy_type", address=address)
        UUT.setup_ipc()

        self.mocks['nmosnode.facade.Proxy'].assert_called_once_with(address)
        self.assertEqual(self.mocks['nmosnode.facade.Proxy'].return_value,
                         UUT.ipc)
コード例 #2
0
    def test_setup_ipc_exception_handling(self):
        address = "ipc:///tmp/nmos-nodefacade.dummy.for.test"
        UUT = Facade("dummy_type", address=address)

        self.mocks['nmosnode.facade.Proxy'].side_effect = Exception

        UUT.setup_ipc()

        self.mocks['nmosnode.facade.Proxy'].assert_called_once_with(address)
        self.assertIsNone(UUT.ipc)