Adds a test for default file init command.

This commit is contained in:
Romain Dorgueil
2017-11-04 12:24:30 +01:00
parent 1108b319db
commit 017bb4a9a6
5 changed files with 24 additions and 9 deletions

View File

@ -112,6 +112,17 @@ def test_install_requirements_for_file(runner):
install_mock.assert_called_once_with(os.path.join(dirname, 'requirements.txt'))
@all_runners
def test_init_file(runner, tmpdir):
target = tmpdir.join('foo.py')
runner('init', str(target))
assert os.path.exists(target)
out, err = runner('run', str(target))
assert out.replace('\n', ' ').strip() == 'Hello World'
assert not err
@all_runners
def test_version(runner):
out, err = runner('version')