bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)

This commit is contained in:
Serhiy Storchaka 2017-04-07 18:56:12 +03:00 committed by GitHub
parent fd0cd07a5a
commit 150cd1916a
4 changed files with 28 additions and 14 deletions

View file

@ -2167,6 +2167,16 @@ class CommandLineTest(unittest.TestCase):
for tardata in files:
tf.add(tardata, arcname=os.path.basename(tardata))
def test_bad_use(self):
rc, out, err = self.tarfilecmd_failure()
self.assertEqual(out, b'')
self.assertIn(b'usage', err.lower())
self.assertIn(b'error', err.lower())
self.assertIn(b'required', err.lower())
rc, out, err = self.tarfilecmd_failure('-l', '')
self.assertEqual(out, b'')
self.assertNotEqual(err.strip(), b'')
def test_test_command(self):
for tar_name in testtarnames:
for opt in '-t', '--test':