feat: Disable stdin from archivebox add

This commit is contained in:
Cristian 2020-07-07 12:39:36 -05:00
parent bca6a06f60
commit b68c13918f
3 changed files with 11 additions and 4 deletions

View file

@ -31,3 +31,9 @@ def test_add_link(tmp_path, process):
output_html = f.read()
assert "Example Domain" in output_html
def test_add_link_does_not_support_stdin(tmp_path, process):
os.chdir(tmp_path)
stdin_process = subprocess.Popen(["archivebox", "add"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = stdin_process.communicate(input="example.com".encode())[0]
assert "does not accept stdin" in output.decode("utf-8")