Beispiel #1
0
def test_rpc_test_client_without_development_installation(
        import_mocker, mocker):

    # Expected error message (Related object)
    from tests.utils.controllers import JSONRPCTestClient
    import_path = f'{JSONRPCTestClient.__module__}.{JSONRPCTestClient.__name__}'
    message = DevelopmentInstallationRequired.MESSAGE.format(
        importable_name=import_path)
    del JSONRPCTestClient

    with import_mocker:
        from nucypher.characters.control.controllers import JSONRPCController  # Import OK
        with pytest.raises(DevelopmentInstallationRequired,
                           match=message):  # Expect lazy failure
            JSONRPCController.test_client(self=mocker.Mock())
Beispiel #2
0
    def make_rpc_controller(self, crash_on_error: bool = False):
        app_name = bytes(self.stamp).hex()[:6]
        controller = JSONRPCController(app_name=app_name,
                                       crash_on_error=crash_on_error,
                                       interface=self.interface)

        self.controller = controller
        return controller
Beispiel #3
0
    def make_rpc_controller(drone, crash_on_error: bool = False):
        app_name = bytes(drone.stamp).hex()[:6]
        controller = JSONRPCController(app_name=app_name,
                                       character_controller=drone.controller,
                                       crash_on_error=crash_on_error)

        drone.controller = controller
        return controller