def test_set_option_destdir(self): """testing set_option().""" command.set_option(self.parser, 'destdir') self.assertEqual('/tmp', self.parser.parse_args('-d /tmp'.split()).destdir) self.assertEqual('/tmp/foo', self.parser.parse_args( '--destdir /tmp/foo'.split()).destdir)
def test_set_option_destdir(self): """testing set_option().""" command.set_option(self.parser, 'destdir') self.assertEqual('/tmp', self.parser.parse_args('-d /tmp'.split()).destdir) self.assertEqual( '/tmp/foo', self.parser.parse_args('--destdir /tmp/foo'.split()).destdir)
def test_set_option_template_path(self): """testing set_option().""" command.set_option(self.parser, 'template_path') self.assertEqual('address.mastache', self.parser.parse_args( '-t address.mastache'.split()).template_path) self.assertEqual('address.mastache', self.parser.parse_args( '--template_path ' 'address.mastache'.split()).template_path)
def test_set_option_template_path(self): """testing set_option().""" command.set_option(self.parser, 'template_path') self.assertEqual( 'address.mastache', self.parser.parse_args( '-t address.mastache'.split()).template_path) self.assertEqual( 'address.mastache', self.parser.parse_args('--template_path ' 'address.mastache'.split()).template_path)
def test_set_option(self): c.set_option(self.prs, 'destdir') self.assertTrue( isinstance( self.prs.__dict__.get('_option_string_actions').get('-d'), argparse._StoreAction) ) c.set_option(self.prs, 'template_path') self.assertTrue( isinstance( self.prs.__dict__.get('_option_string_actions').get('-t'), argparse._StoreAction) )
def test_generate_atena(self): """testing generate_atena().""" command.set_option(self.parser, 'destdir') command.set_option(self.parser, 'template_path') command.set_option(self.parser, 'address_list') args = self.parser.parse_args('-d /tmp/ ' '-t template/address.mustache ' 'example/address.csv'.split()) control.generate_atena(args) self.assertTrue(os.path.exists('/tmp/address.tex'))
def test_set_option_address_list(self): """testing set_option().""" command.set_option(self.parser, 'address_list') self.assertEqual('address.csv', self.parser.parse_args( 'address.csv'.split()).address_list)
def test_set_option_address_list(self): """testing set_option().""" command.set_option(self.parser, 'address_list') self.assertEqual( 'address.csv', self.parser.parse_args('address.csv'.split()).address_list)