<s> import os <EOL> import unittest <EOL> import tempfile <EOL> import shutil <EOL> try : <EOL> from catkin_pkg . package_templates import PackageTemplate <EOL> except ImportError as impe : <EOL> raise ImportError ( <EOL> '<STR_LIT>' % str ( impe ) ) <EOL> import imp <EOL> imp . load_source ( '<STR_LIT>' , <EOL> os . path . join ( os . path . dirname ( __file__ ) , <EOL> '<STR_LIT:..>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> from catkin_create_pkg import main <EOL> class CreatePkgTest ( unittest . TestCase ) : <EOL> def test_create_package_template ( self ) : <EOL> template = PackageTemplate . _create_package_template ( '<STR_LIT>' ) <EOL> self . assertEqual ( '<STR_LIT>' , template . name ) <EOL> self . assertEqual ( '<STR_LIT>' , template . version ) <EOL> self . assertEqual ( '<STR_LIT>' , template . description ) <EOL> self . assertEqual ( [ ] , template . catkin_deps ) <EOL> self . assertEqual ( [ ] , template . authors ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( template . maintainers ) ) <EOL> self . assertIsNotNone ( template . maintainers [ <NUM_LIT:0> ] . email ) <EOL> self . assertEqual ( [ ] , template . urls ) <EOL> template = PackageTemplate . _create_package_template ( <EOL> '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> licenses = [ '<STR_LIT:a>' , '<STR_LIT:b>' ] , <EOL> maintainer_names = [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> author_names = [ '<STR_LIT>' ] , <EOL> version = '<STR_LIT>' , <EOL> catkin_deps = [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( '<STR_LIT>' , template . name ) <EOL> self . assertEqual ( '<STR_LIT>' , template . version ) <EOL> self . assertEqual ( '<STR_LIT>' , template . description ) <EOL> self . assertEqual ( [ '<STR_LIT>' , '<STR_LIT>' ] , template . catkin_deps ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( template . authors ) ) <EOL> self . assertEqual ( '<STR_LIT>' , template . maintainers [ <NUM_LIT:0> ] . name ) <EOL> self . assertEqual ( '<STR_LIT>' , template . maintainers [ <NUM_LIT:1> ] . name ) <EOL> self . assertEqual ( '<STR_LIT>' , template . authors [ <NUM_LIT:0> ] . name ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( template . maintainers ) ) <EOL> self . assertEqual ( [ ] , template . urls ) <EOL> def test_main ( self ) : <EOL> try : <EOL> root_dir = tempfile . mkdtemp ( ) <EOL> main ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:foo>' ] , root_dir ) <EOL> self . assertTrue ( os . path . isdir ( os . path . join ( root_dir , '<STR_LIT:foo>' ) ) ) <EOL> self . assertTrue ( os . path . isfile ( os . path . join ( root_dir , '<STR_LIT:foo>' , '<STR_LIT>' ) ) ) <EOL> self . assertTrue ( os . path . isfile ( os . path . join ( root_dir , '<STR_LIT:foo>' , '<STR_LIT>' ) ) ) <EOL> finally : <EOL> shutil . rmtree ( root_dir ) </s>
