From 3c13fa01afc8b3506fbc8296d0b97cefab34ef83 Mon Sep 17 00:00:00 2001 From: Jonathan Zernik Date: Tue, 28 Jul 2020 19:49:44 -0700 Subject: [PATCH] Use pytest for itest (#161) * Use pytest for itest * Use pytest for itests --- docker/test/Dockerfile | 3 ++- itests/test.sh | 2 +- itests/tests/__init__.py | 0 itests/{test.py => tests/test_buy.py} | 8 ++++---- requirements-itest.txt | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 itests/tests/__init__.py rename itests/{test.py => tests/test_buy.py} (99%) diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index 0adfe689..9359f606 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -16,7 +16,8 @@ WORKDIR /app RUN git clone https://github.com/googleapis/googleapis.git COPY proto ./proto -COPY install-rpc.sh itests/test.sh itests/test.py squeakserver/common/lnd_lightning_client.py ./ +COPY install-rpc.sh itests/test.sh squeakserver/common/lnd_lightning_client.py ./ +COPY itests/tests ./tests # Install the gRPC files. RUN chmod +x install-rpc.sh && \ diff --git a/itests/test.sh b/itests/test.sh index 27759385..ea9ae9d9 100644 --- a/itests/test.sh +++ b/itests/test.sh @@ -1,3 +1,3 @@ #!/bin/bash -python3 test.py +pytest -s tests diff --git a/itests/tests/__init__.py b/itests/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/itests/test.py b/itests/tests/test_buy.py similarity index 99% rename from itests/test.py rename to itests/tests/test_buy.py index e788cced..5c69b665 100644 --- a/itests/test.py +++ b/itests/tests/test_buy.py @@ -92,7 +92,7 @@ def string_to_hex(s): return bytes.fromhex(s) -def run(): +def test_buy_squeak(): # Set the network to simnet for itest. SelectParams("mainnet") @@ -471,6 +471,6 @@ def run(): ) -if __name__ == "__main__": - logging.basicConfig() - run() +# if __name__ == "__main__": +# logging.basicConfig() +# run() diff --git a/requirements-itest.txt b/requirements-itest.txt index 24c1aef2..20122639 100644 --- a/requirements-itest.txt +++ b/requirements-itest.txt @@ -4,3 +4,4 @@ argparse googleapis-common-protos grpcio grpcio-tools +pytest