The tests in this folder are not regular Pytest tests.
They are implemented with BATS to test scripts in the bin folder of this repo.
Install BATS: If you don't have BATS installed, you need to install it first. On a Unix-like system, you can usually install it using a package manager.
For Debian-based systems (e.g., Ubuntu):
sudo apt-get update
sudo apt-get install batsFor macOS using Homebrew:
brew install bats-coreAlternatively, you can install BATS manually by cloning the repository and adding the bin folder to your PATH environment variable.
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/localCreate a file with a .bats extension, for example, test_example.bats. Here’s a simple test file:
#!/usr/bin/env bats
@test "test description" {
run echo "hello"
[ "$status" -eq 0 ]
[ "$output" = "hello" ]
}To run the tests, simply execute the bats command followed by the test file or directory containing test files:
bats test_example.batsYou can also run all .bats files in a directory:
bats tests/binTo run with some debug information, you can use this:
bats --trace --verbose-run --print-output-on-failure -r tests/bin/