mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 18:33:17 +00:00
[test_verbose_output] Fix tests under Python 3
This commit is contained in:
parent
e97c55ee6a
commit
52aa7e7476
|
@ -22,10 +22,10 @@ def test_private_info_arg(self):
|
||||||
'--password', 'secret',
|
'--password', 'secret',
|
||||||
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
sout, serr = outp.communicate()
|
sout, serr = outp.communicate()
|
||||||
self.assertTrue('--username' in serr)
|
self.assertTrue(b'--username' in serr)
|
||||||
self.assertTrue('johnsmith' not in serr)
|
self.assertTrue(b'johnsmith' not in serr)
|
||||||
self.assertTrue('--password' in serr)
|
self.assertTrue(b'--password' in serr)
|
||||||
self.assertTrue('secret' not in serr)
|
self.assertTrue(b'secret' not in serr)
|
||||||
|
|
||||||
def test_private_info_shortarg(self):
|
def test_private_info_shortarg(self):
|
||||||
outp = subprocess.Popen(
|
outp = subprocess.Popen(
|
||||||
|
@ -35,10 +35,10 @@ def test_private_info_shortarg(self):
|
||||||
'-p', 'secret',
|
'-p', 'secret',
|
||||||
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
sout, serr = outp.communicate()
|
sout, serr = outp.communicate()
|
||||||
self.assertTrue('-u' in serr)
|
self.assertTrue(b'-u' in serr)
|
||||||
self.assertTrue('johnsmith' not in serr)
|
self.assertTrue(b'johnsmith' not in serr)
|
||||||
self.assertTrue('-p' in serr)
|
self.assertTrue(b'-p' in serr)
|
||||||
self.assertTrue('secret' not in serr)
|
self.assertTrue(b'secret' not in serr)
|
||||||
|
|
||||||
def test_private_info_eq(self):
|
def test_private_info_eq(self):
|
||||||
outp = subprocess.Popen(
|
outp = subprocess.Popen(
|
||||||
|
@ -48,10 +48,10 @@ def test_private_info_eq(self):
|
||||||
'--password=secret',
|
'--password=secret',
|
||||||
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
sout, serr = outp.communicate()
|
sout, serr = outp.communicate()
|
||||||
self.assertTrue('--username' in serr)
|
self.assertTrue(b'--username' in serr)
|
||||||
self.assertTrue('johnsmith' not in serr)
|
self.assertTrue(b'johnsmith' not in serr)
|
||||||
self.assertTrue('--password' in serr)
|
self.assertTrue(b'--password' in serr)
|
||||||
self.assertTrue('secret' not in serr)
|
self.assertTrue(b'secret' not in serr)
|
||||||
|
|
||||||
def test_private_info_shortarg_eq(self):
|
def test_private_info_shortarg_eq(self):
|
||||||
outp = subprocess.Popen(
|
outp = subprocess.Popen(
|
||||||
|
@ -61,10 +61,10 @@ def test_private_info_shortarg_eq(self):
|
||||||
'-p=secret',
|
'-p=secret',
|
||||||
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
sout, serr = outp.communicate()
|
sout, serr = outp.communicate()
|
||||||
self.assertTrue('-u' in serr)
|
self.assertTrue(b'-u' in serr)
|
||||||
self.assertTrue('johnsmith' not in serr)
|
self.assertTrue(b'johnsmith' not in serr)
|
||||||
self.assertTrue('-p' in serr)
|
self.assertTrue(b'-p' in serr)
|
||||||
self.assertTrue('secret' not in serr)
|
self.assertTrue(b'secret' not in serr)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in a new issue