Skip to content

Commit

Permalink
pytest: fix if no rust installed.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Apr 1, 2022
1 parent bba68e2 commit 3feb634
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_cln_rs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from fixtures import * # noqa: F401,F403
from node_pb2_grpc import NodeStub
from pathlib import Path
from pyln.testing.utils import env, TEST_NETWORK, wait_for
from ephemeral_port_reserve import reserve
import grpc
import node_pb2 as nodepb
from primitives_pb2 import AmountOrAny
import pytest
import subprocess
Expand Down Expand Up @@ -74,6 +72,10 @@ def test_plugin_start(node_factory):

def test_grpc_connect(node_factory):
"""Attempts to connect to the grpc interface and call getinfo"""
# These only exist if we have rust!
from node_pb2_grpc import NodeStub # noqa: E402
import node_pb2 as nodepb # noqa: E402

grpc_port = reserve()
bin_path = Path.cwd() / "target" / "debug" / "cln-grpc"
l1 = node_factory.get_node(options={"plugin": str(bin_path), "grpc-port": str(grpc_port)})
Expand Down Expand Up @@ -172,6 +174,10 @@ def test_grpc_wrong_auth(node_factory):
We create two instances, each generates its own certs and keys,
and then we try to cross the wires.
"""
# These only exist if we have rust!
from node_pb2_grpc import NodeStub # noqa: E402
import node_pb2 as nodepb # noqa: E402

grpc_port = reserve()
bin_path = Path.cwd() / "target" / "debug" / "cln-grpc"
l1, l2 = node_factory.get_nodes(2, opts={
Expand Down

0 comments on commit 3feb634

Please sign in to comment.