<s> import os <EOL> import shutil <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT:..>' ) ) <EOL> from test . utils import AbstractCatkinWorkspaceTest , MOCK_DIR , MAKE_CMD , succeed , assert_exists , fail <EOL> import em <EOL> import sys <EOL> import stat <EOL> import unittest <EOL> import tempfile <EOL> class MockTest ( AbstractCatkinWorkspaceTest ) : <EOL> """<STR_LIT>""" <EOL> def test_catkin_only ( self ) : <EOL> self . cmake ( ) <EOL> succeed ( MAKE_CMD , cwd = self . builddir ) <EOL> succeed ( MAKE_CMD + [ "<STR_LIT>" ] , cwd = self . builddir ) <EOL> assert_exists ( self . installdir , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> def test_nolang ( self ) : <EOL> dstdir = os . path . join ( self . workspacedir , '<STR_LIT>' ) <EOL> shutil . copytree ( os . path . join ( MOCK_DIR , '<STR_LIT:src>' , '<STR_LIT>' ) , dstdir ) <EOL> out = self . cmake ( CATKIN_WHITELIST_PACKAGES = '<STR_LIT>' , <EOL> CATKIN_DPKG_BUILDPACKAGE_FLAGS = '<STR_LIT>' ) <EOL> self . assertTrue ( os . path . exists ( self . builddir + "<STR_LIT>" ) ) <EOL> self . assertFalse ( os . path . exists ( self . builddir + "<STR_LIT>" ) ) <EOL> self . assertFalse ( os . path . exists ( self . builddir + "<STR_LIT>" ) ) <EOL> out = succeed ( MAKE_CMD , cwd = self . builddir ) <EOL> self . assertTrue ( os . path . exists ( self . builddir + <EOL> "<STR_LIT>" ) ) <EOL> out = succeed ( MAKE_CMD + [ "<STR_LIT>" ] , cwd = self . builddir ) <EOL> assert_exists ( self . installdir , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> succeed ( MAKE_CMD + [ "<STR_LIT>" ] , cwd = self . builddir ) <EOL> def test_noproject ( self ) : <EOL> dstdir = os . path . join ( self . workspacedir , '<STR_LIT>' ) <EOL> shutil . copytree ( os . path . join ( MOCK_DIR , '<STR_LIT>' , '<STR_LIT>' ) , dstdir ) <EOL> out = self . cmake ( CATKIN_WHITELIST_PACKAGES = '<STR_LIT>' ) <EOL> out = succeed ( MAKE_CMD + [ "<STR_LIT>" ] , cwd = self . builddir ) <EOL> shutil . rmtree ( self . builddir ) <EOL> os . makedirs ( self . builddir ) <EOL> out = self . cmake ( CMAKE_PREFIX_PATH = self . installdir , <EOL> expect = fail ) <EOL> print ( "<STR_LIT>" , out ) <EOL> self . assertTrue ( b"<STR_LIT>" in out , out ) <EOL> def test_env_cached_static ( self ) : <EOL> sys . stdout = em . ProxyFile ( sys . stdout ) <EOL> dstdir = os . path . join ( self . workspacedir , '<STR_LIT>' ) <EOL> shutil . copytree ( os . path . join ( MOCK_DIR , '<STR_LIT:src>' , '<STR_LIT>' ) , dstdir ) <EOL> template_file = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT:..>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> with open ( template_file , '<STR_LIT:r>' ) as fhand : <EOL> template = fhand . read ( ) <EOL> gdict = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> result = em . expand ( template , gdict , <EOL> source_root_dir = self . workspacedir , <EOL> whitelisted_packages = None , <EOL> blacklisted_packages = None , <EOL> underlay_workspaces = None ) <EOL> self . assertTrue ( '<STR_LIT>' in result , result ) <EOL> self . assertTrue ( '<STR_LIT>' in result , result ) <EOL> self . assertTrue ( '<STR_LIT>' in result , result ) <EOL> self . assertTrue ( '<STR_LIT>' in result , result ) <EOL> self . assertTrue ( """<STR_LIT>""" in result , result ) <EOL> self . assertTrue ( """<STR_LIT>""" in result , result ) <EOL> self . assertFalse ( '<STR_LIT>' in result , result ) <EOL> self . assertEqual ( <NUM_LIT> , len ( result . splitlines ( ) ) ) </s>
