def testInit(self, mock_os): mock_os.environ.get.side_effect = lambda x: True if x == "GLITE_LOCATION" or x == "GRID_ENV_LOCATION" else False mock_os.path.isfile.return_value = True mock_os.path.normpath.side_effect = lambda x: "home" + x mock_os.path.join.side_effect = lambda a, b: os.path.join("", b) testLCGImpl = LCGImpl(True) self.assertTrue(testLCGImpl.stageIn) setups = [] setups += ['source home/../etc/profile.d/grid-env.sh; '] setups += ['source home/grid-env.sh; '] setups += ['date "+%Y-%m-%dT%H:%M:%S"; '] self.assertTrue(testLCGImpl.stageIn) for setup in setups: self.assertIn(setup, testLCGImpl.setups)
def __init__(self, stagein=False): StageOutImpl.__init__(self, stagein) # Create and hold onto a srm implementation in case we need it self.srmImpl = LCGImpl(stagein)
def setUp(self): self.LCGImpl = LCGImpl() self.LCGImpl.setups = self.setups = "test setups" self.timeoutOptions = self.LCGImpl.timeoutOptions = \ '--srm-timeout 600 --sendreceive-timeout 600 --connect-timeout 300'