Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Arguments:

Options:
-h --help Show this screen.
-p --proxy <prox> Use a proxy while uploading.
-x --proxy <prox> Use a proxy while uploading.
-u --username <user> Provide a username, for sites like Nico Nico Douga.
-p --password <pass> Provide a password, for sites like Nico Nico Douga.
-a --use-download-archive Record the video url to the download archive.
Expand Down
20 changes: 20 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import docopt

import tubeup.__main__ as cli


def test_proxy_short_option_sets_proxy():
args = docopt.docopt(
cli.__doc__,
argv=['-x', 'socks5://localhost:9050', 'https://example.com/watch?v=abc123'])

assert args['--proxy'] == 'socks5://localhost:9050'


def test_password_short_option_sets_password():
args = docopt.docopt(
cli.__doc__,
argv=['-p', 'secret', 'https://example.com/watch?v=abc123'])

assert args['--password'] == 'secret'
assert args['--proxy'] is None
2 changes: 1 addition & 1 deletion tubeup/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

Options:
-h --help Show this screen.
-p --proxy <prox> Use a proxy while uploading.
-x --proxy <prox> Use a proxy while uploading.
-u --username <user> Provide a username, for sites like Nico Nico Douga.
-p --password <pass> Provide a password, for sites like Nico Nico Douga.
-a --use-download-archive Record the video url to the download archive.
Expand Down
Loading