summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
authorJethro Cao <jethrocao@gmail.com>2020-03-11 13:58:08 +0800
committerDavid Lord <davidism@gmail.com>2020-08-13 23:17:27 -0700
commit7d7809fcd0940c9a272b5aaeba3ec96bc8b682c1 (patch)
treecbfa69bff1a82b44b435c516a9a81fb686351b9c /tests/test_testing.py
parent10103e3835a381185f786745c0281237f0b238ae (diff)
downloadclick-7d7809fcd0940c9a272b5aaeba3ec96bc8b682c1.tar.gz
CliRunner isolation streams have name and mode
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 86c8708..758e173 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -308,3 +308,14 @@ def test_command_standalone_mode_returns_value():
assert result.output == "ok\n"
assert result.return_value == "Hello, World!"
assert result.exit_code == 0
+
+
+def test_file_stdin_attrs(runner):
+ @click.command()
+ @click.argument("f", type=click.File())
+ def cli(f):
+ click.echo(f.name)
+ click.echo(f.mode, nl=False)
+
+ result = runner.invoke(cli, ["-"])
+ assert result.output == "<stdin>\nr"