class VariationParserTest(unittest.TestCase): def setUp(self): self._parser = VariationParser('variation.txt') def test_parsing(self): rc_adjustment = self._parser.parse() self.assertEqual(0.9, rc_adjustment.get_adjustment(200, CoordSelector.LEFT)) self.assertEqual(0.8, rc_adjustment.get_adjustment(100, CoordSelector.LEFT)) self.assertEqual(1.1, rc_adjustment.get_adjustment(50, CoordSelector.RIGHT)) self.assertEqual(0.85, rc_adjustment.get_adjustment(150, CoordSelector.LEFT)) self.assertEqual(0.85, rc_adjustment.get_adjustment(300, CoordSelector.RIGHT))
def main(argv): if len(argv) != len(expected_args): show_usage() root, unit_rc_list = parse(argv) rc_adjustment = VariationParser(argv[4]).parse() Dumper([ DFS(root, unit_rc, rc_adjustment).delay()[0] for unit_rc in unit_rc_list ], os.path.abspath(argv[5])).dump() print 'Worst case calculation succeed! Refer to \'%s\'!\n' % argv[5]
def setUp(self): self._parser = VariationParser('variation.txt')