summaryrefslogtreecommitdiff
path: root/tests/test_arguments.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-05-23 20:28:13 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2014-05-23 20:28:13 +0200
commit50469da33c5ca387a36b5318256542ac0cb17de0 (patch)
treead955759774a7706ec17b9548f32177eeddc5e29 /tests/test_arguments.py
parentf4cfcb5788343f1f17e165eebe20b58dbf45d598 (diff)
downloadclick-50469da33c5ca387a36b5318256542ac0cb17de0.tar.gz
Fixed a bug that caused text files on 2.x to not accept bytestrings.
Diffstat (limited to 'tests/test_arguments.py')
-rw-r--r--tests/test_arguments.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_arguments.py b/tests/test_arguments.py
index 13d1c25..8e15d24 100644
--- a/tests/test_arguments.py
+++ b/tests/test_arguments.py
@@ -72,6 +72,18 @@ def test_file_args(runner):
assert result.exit_code == 0
+def test_stdout_default(runner):
+ @click.command()
+ @click.argument('output', type=click.File('w'), default='-')
+ def inout(output):
+ output.write('Foo bar baz\n')
+ output.flush()
+
+ result = runner.invoke(inout, [])
+ assert not result.exception
+ assert result.output == 'Foo bar baz\n'
+
+
def test_nargs_envvar(runner):
@click.command()
@click.option('--arg', nargs=-1)