]> jfr.im git - yt-dlp.git/blame - test/test_verbose_output.py
[skip travis] renaming
[yt-dlp.git] / test / test_verbose_output.py
CommitLineData
ce28252c
PH
1#!/usr/bin/env python
2# coding: utf-8
3
4from __future__ import unicode_literals
5
6import unittest
7
8import sys
9import os
10import subprocess
11sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12
13rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
14
15
16class TestVerboseOutput(unittest.TestCase):
17 def test_private_info_arg(self):
18 outp = subprocess.Popen(
19 [
cefecac1 20 sys.executable, 'youtube_dlc/__main__.py', '-v',
ce28252c
PH
21 '--username', 'johnsmith@gmail.com',
22 '--password', 'secret',
23 ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
24 sout, serr = outp.communicate()
52aa7e74
YCH
25 self.assertTrue(b'--username' in serr)
26 self.assertTrue(b'johnsmith' not in serr)
27 self.assertTrue(b'--password' in serr)
28 self.assertTrue(b'secret' not in serr)
ce28252c
PH
29
30 def test_private_info_shortarg(self):
31 outp = subprocess.Popen(
32 [
cefecac1 33 sys.executable, 'youtube_dlc/__main__.py', '-v',
ce28252c
PH
34 '-u', 'johnsmith@gmail.com',
35 '-p', 'secret',
36 ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
37 sout, serr = outp.communicate()
52aa7e74
YCH
38 self.assertTrue(b'-u' in serr)
39 self.assertTrue(b'johnsmith' not in serr)
40 self.assertTrue(b'-p' in serr)
41 self.assertTrue(b'secret' not in serr)
ce28252c
PH
42
43 def test_private_info_eq(self):
44 outp = subprocess.Popen(
45 [
cefecac1 46 sys.executable, 'youtube_dlc/__main__.py', '-v',
ce28252c
PH
47 '--username=johnsmith@gmail.com',
48 '--password=secret',
49 ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
50 sout, serr = outp.communicate()
52aa7e74
YCH
51 self.assertTrue(b'--username' in serr)
52 self.assertTrue(b'johnsmith' not in serr)
53 self.assertTrue(b'--password' in serr)
54 self.assertTrue(b'secret' not in serr)
ce28252c
PH
55
56 def test_private_info_shortarg_eq(self):
57 outp = subprocess.Popen(
58 [
cefecac1 59 sys.executable, 'youtube_dlc/__main__.py', '-v',
ce28252c
PH
60 '-u=johnsmith@gmail.com',
61 '-p=secret',
62 ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
63 sout, serr = outp.communicate()
52aa7e74
YCH
64 self.assertTrue(b'-u' in serr)
65 self.assertTrue(b'johnsmith' not in serr)
66 self.assertTrue(b'-p' in serr)
67 self.assertTrue(b'secret' not in serr)
ce28252c 68
582be358 69
ce28252c
PH
70if __name__ == '__main__':
71 unittest.main()