Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 9 additions & 38 deletions payjoin-ffi/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,14 @@ Grab the latest release with a simple:
pip install payjoin
```

## Running Unit Tests
Follow these steps to clone the repository and run the unit tests:
## Running Tests

```shell

git clone https://github.com/LtbLightning/payjoin-ffi.git
cd python

# Setup a python virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install --requirement requirements.txt --requirement requirements-dev.txt

# Generate the bindings (use the script appropriate for your platform)
PYBIN="./venv/bin/" bash ./scripts/generate_<platform>.sh

# Build the wheel
python setup.py bdist_wheel --verbose
Follow these steps to clone the repository and run the tests.

# Force reinstall payjoin
pip install ./dist/payjoin-<version>.whl --force-reinstall

# Run unit tests
python -m unittest --verbose test/payjoin_unit_test.py

```

## Running the Integration Test

Before diving into the integration test, you'll need to set up Bitcoin Core on the regtest network. If you don't have Bitcoin Core installed locally, check out [this installation guide](https://learn.saylor.org/mod/page/view.php?id=36347). Alternatively, you can use `Nigiri Bitcoin`, a tool designed to streamline the process of running local instances of Bitcoin and Liquid networks for development and testing. Follow the instructions [here](https://github.com/vulpemventures/nigiri) to install it on your machine.

Now, proceed with the integration test:

```shell

git clone https://github.com/LtbLightning/payjoin-ffi.git
cd python
git clone https://github.com/payjoin/rust-payjoin.git
cd rust-payjoin/payjoin-ffi/python

# Setup a python virtual environment
python -m venv venv
Expand All @@ -66,11 +35,13 @@ python setup.py bdist_wheel --verbose
# Force reinstall payjoin
pip install ./dist/payjoin-<version>.whl --force-reinstall

# Run the integration test
python -m unittest --verbose test/payjoin_integration_test.py

# Run all tests
python -m unittest --verbose
```

Note that you'll need Docker to run the integration tests. If you get a "Failed to start container" error, ensure the Docker engine is running on your machine.
You can [filter which tests](https://docs.python.org/3/library/unittest.html#command-line-interface) to run by passing a file or test name as argument.

## Building the Package

```shell
Expand Down
Loading