Exemple #1
0
 def testShortOtions(self):
   self.assertEqual(pdfmunge.handle_options(["-r", "-b", "4,5,6,7",
                                             "-o", "2,3,4,5",
                                             "-e", "1,2,5-7,100-102",
                                             "-i", "1,15-16",
                                             "-m", "3", "infile","outfile"]),
                    {'rotate': True, 'bounds': [4,5,6,7],
                     'oddbounds': [2,3,4,5], 'exclude': [0,1,4,5,6,99,100,101],
                     'intact': [0,14,15], 'margin': 3, 'infile': 'infile',
                     'outfile': 'outfile'})
Exemple #2
0
 def testLongOptions(self):
   self.assertEqual(pdfmunge.handle_options(["--rotate", "--bounds", "4,5,6,7",
                                             "--oddbounds", "2,3,4,5",
                                             "--exclude", "1,2,5-7,100-102",
                                             "--intact", "1,15-16",
                                             "--margin", 3,
                                             "infile", "outfile"]),
                    {'rotate': True, 'bounds': [4,5,6,7],
                     'oddbounds': [2,3,4,5], 'exclude': [0,1,4,5,6,99,100,101],
                     'intact': [0,14,15], 'margin': 3, 'infile': 'infile',
                     'outfile': 'outfile'})
Exemple #3
0
 def testDefaults(self):
   self.assertEqual(pdfmunge.handle_options(["infile", "outfile"]),
                    {'rotate': False, 'exclude': [], 'intact': [],
                     'margin': 0, 'infile': 'infile', 'outfile':'outfile'})