]> Raphaƫl G. Git Repositories - youtubedl/blob - test/test_options.py
d/p/disable_more_online_tests.patch: Disable remaining tests that require internet.
[youtubedl] / test / test_options.py
1 # coding: utf-8
2
3 from __future__ import unicode_literals
4
5 # Allow direct execution
6 import os
7 import sys
8 import unittest
9 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
10
11 from youtube_dl.options import _hide_login_info
12
13
14 class TestOptions(unittest.TestCase):
15 def test_hide_login_info(self):
16 self.assertEqual(_hide_login_info(['-u', 'foo', '-p', 'bar']),
17 ['-u', 'PRIVATE', '-p', 'PRIVATE'])
18 self.assertEqual(_hide_login_info(['-u']), ['-u'])
19 self.assertEqual(_hide_login_info(['-u', 'foo', '-u', 'bar']),
20 ['-u', 'PRIVATE', '-u', 'PRIVATE'])
21 self.assertEqual(_hide_login_info(['--username=foo']),
22 ['--username=PRIVATE'])
23
24
25 if __name__ == '__main__':
26 unittest.main()