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' ]))
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' ]))
def testBadArg(self): with NoOutput(): self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args, (['--badarg']))
def testBadXLayerChoice(self): with NoOutput(): self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args, (['-x','terrain,weirdlayer']))
def testBadPageChoice(self): with NoOutput(): self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args, (['-p','weirdpaper']))
def testHelp(self): with NoOutput(): self.assertRaises(SystemExit, drawboard.setupArgParser().parse_args, (['-h']))