Пример #1
0
 def testLongValid(self):
     self.assertTrue(drawboard.setupArgParser().parse_args([
         'scenario.m44',
         'outputbase.png',
         '--appdir','/some/dir',
         '--hexwidth','1.5',
         '--page_size','letter',
         '--margin','0.5',
         '--overlap','0.25',
         '--xlayers','terrain,lines,rect_terrain,obstacle,unit,tags,text'
     ]))      
Пример #2
0
 def testShortValid(self):
     self.assertTrue(drawboard.setupArgParser().parse_args([
         '-a','/some/dir',
         '-w','1.5',
         '-p','letter',
         '-m','0.5',
         '-o','0.25',
         '-x','terrain,lines,rect_terrain,obstacle,unit,tags,text',
         'scenario.m44',
         'outputbase.png'
     ]))
Пример #3
0
 def testBadArg(self):
     with NoOutput():
         self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args,
             (['--badarg']))
Пример #4
0
 def testBadXLayerChoice(self):
     with NoOutput():
         self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args,
             (['-x','terrain,weirdlayer']))
Пример #5
0
 def testBadPageChoice(self):
     with NoOutput():
         self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args,
             (['-p','weirdpaper']))
Пример #6
0
 def testHelp(self):
     with NoOutput():
         self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args,
             (['-h']))