Minor fixes and update documentation. Preparing the upcoming 0.2 release.
This commit is contained in:
14
tests/test_basicusage.py
Normal file
14
tests/test_basicusage.py
Normal 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
32
tests/test_commands.py
Normal 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 ')
|
||||
@ -1,4 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from bonobo import Configurable, Option
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user