Add tests for bonobo init new directory and init within empty directory
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import runpy
|
import runpy
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
@ -43,6 +44,27 @@ def test_no_command(runner, capsys):
|
|||||||
assert 'error: the following arguments are required: command' in err
|
assert 'error: the following arguments are required: command' in err
|
||||||
|
|
||||||
|
|
||||||
|
@all_runners
|
||||||
|
def test_init(runner, capsys):
|
||||||
|
runner('init', 'project-name')
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
out = out.strip()
|
||||||
|
shutil.rmtree('project-name')
|
||||||
|
assert out == ''
|
||||||
|
|
||||||
|
|
||||||
|
@all_runners
|
||||||
|
def test_init_within_empty_directory(runner, capsys):
|
||||||
|
os.mkdir('empty-directory')
|
||||||
|
os.chdir('empty-directory')
|
||||||
|
runner('init', '.')
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
out = out.strip()
|
||||||
|
os.chdir('..')
|
||||||
|
shutil.rmtree('empty-directory')
|
||||||
|
assert out == ''
|
||||||
|
|
||||||
|
|
||||||
@all_runners
|
@all_runners
|
||||||
def test_run(runner, capsys):
|
def test_run(runner, capsys):
|
||||||
runner('run', '--quiet', get_examples_path('types/strings.py'))
|
runner('run', '--quiet', get_examples_path('types/strings.py'))
|
||||||
|
|||||||
Reference in New Issue
Block a user