Metadata-Version: 2.4
Name: akane
Version: 1.1.0
Summary: Simple, stronly typed library to create tests for anything
Home-page: https://github.com/zekrotja/akane
Download-URL: https://github.com/zekrotja/akane/archive/main.tar.gz
Author: zekro
Author-email: contact@zekro.de
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: download-url
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# akane

A very simple, strongly typed library to easily create test cases for anything.

> **Info**  
> This project is mostly purpose built to create e2e integration tests for my CLI apps
> (like [goup](https://github.com/zekroTJA/goup), for example). I wanted something lean
> which takes almost no effort to write tests with. Feel free to use it for your own 
> projects, but don't expect a great developer experience.  
>
> If you are looking for proper testing libraries, feel free to take a look into the
> following resources.  
> - [unittest](https://docs.python.org/3/library/unittest.html)
> - [Robot Framework](https://robotframework.org/)
> - [pytest](https://github.com/pytest-dev/pytest)

## Installation

```
pip install akane
```

or

```
pip install git+https://github.com/zekrotja/akane.git
```

## Example

> This example is also availble in the [examples](examples/simple/main.py) directory.
```py
import os
import akane
from akane.assertions import assert_eq
from akane.procedures import setup, test, teardown


@setup()
def init_env_vars():
    os.environ["FOO"] = "bar"


@test(name="environment variables")
def test_env():
    assert_eq("bar", os.environ["FOO"])


@test(name="environment in shell")
def test_cmd():
    res = akane.exec(("sh", "-c", "echo $FOO"))
    assert_eq("bar\n", res)


@test(name="failing test")
def fails():
    return (False, "whoops")


@teardown(name="environment variables")
def delete_env_vars():
    del os.environ["FOO"]


def main() -> int:
    return akane.run_all()


if __name__ == "__main__":
    exit(main())
```
