Minor fixes and update documentation. Preparing the upcoming 0.2 release.

This commit is contained in:
Romain Dorgueil
2017-01-20 20:45:16 +01:00
parent e57ec4a4b3
commit 9dab39a474
67 changed files with 845 additions and 714 deletions

14
tests/test_basicusage.py Normal file
View File

@ -0,0 +1,14 @@
import pytest
import bonobo as bb
@pytest.mark.timeout(2)
def test_run_graph_noop():
graph = bb.Graph(
bb.noop
)
assert len(graph) == 1
result = bb.run(graph, strategy='threadpool')
assert result

32
tests/test_commands.py Normal file
View File

@ -0,0 +1,32 @@
import pkg_resources
import pytest
from bonobo import get_examples_path
from bonobo.commands import entrypoint
def test_entrypoint():
commands = {}
for command in pkg_resources.iter_entry_points('bonobo.commands'):
commands[command.name] = command
assert 'init' in commands
assert 'run' in commands
def test_no_command(capsys):
with pytest.raises(SystemExit):
entrypoint([])
out, err = capsys.readouterr()
assert 'error: the following arguments are required: command' in err
def test_init():
pass # need ext dir
def test_run(capsys):
entrypoint(['run', '--quiet', get_examples_path('types/strings.py')])
out, err = capsys.readouterr()
out = out.split('\n')
assert out[0].startswith('Foo ')
assert out[1].startswith('Bar ')
assert out[2].startswith('Baz ')

View File

@ -1,4 +1,5 @@
import pytest
from bonobo import Configurable, Option