def test_listing_commands(self):
        args = argparse.Namespace(archive='sample.rar',
                                  command='l',
                                  overwrite=None,
                                  password=None,
                                  rest=[])
        self.assertEqual(('lsar', ['-l']), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='lb',
                                  overwrite=None,
                                  password=None,
                                  rest=[])
        self.assertEqual(('lsar', []), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='lt',
                                  overwrite=None,
                                  password=None,
                                  rest=[])
        self.assertEqual(('lsar', ['-L']), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='lta',
                                  overwrite=None,
                                  password=None,
                                  rest=[])
        self.assertEqual(('lsar', ['-L']), uw.transform_syntax(args))
    def test_unar_lsar_password_option(self):
        args = argparse.Namespace(archive='sample.rar',
                                  command='x',
                                  overwrite=None,
                                  password='******',
                                  rest=[])
        self.assertEqual(('unar', ['-p', "mypass"]), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='lb',
                                  overwrite=None,
                                  password='******',
                                  rest=[])
        self.assertEqual(('lsar', ['-p', "mypass"]), uw.transform_syntax(args))
 def test_test_command(self):
     args = argparse.Namespace(archive='sample.rar',
                               command='t',
                               overwrite=None,
                               password=None,
                               rest=[])
     self.assertEqual(('lsar', ['-t']), uw.transform_syntax(args))
    def test_unar_overwrite_options(self):
        args = argparse.Namespace(archive='sample.rar',
                                  command='x',
                                  overwrite='+',
                                  password=None,
                                  rest=[])
        self.assertEqual(('unar', ['-f']), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='x',
                                  overwrite='-',
                                  password=None,
                                  rest=[])
        self.assertEqual(('unar', ['-s']), uw.transform_syntax(args))

        args = argparse.Namespace(archive='sample.rar',
                                  command='x',
                                  overwrite='r',
                                  password=None,
                                  rest=[])
        self.assertEqual(('unar', ['-r']), uw.transform_syntax(args))