def test_localworkdir_jobid(self): with patch('hod.config.template._current_user', return_value='username'): with patch('os.getpid', return_value='123'): with patch('socket.getfqdn', return_value='hostname'): with patch('os.getenv', return_value='jobid'): self.assertEqual( 'workdir/hod/jobid/username.hostname.123', hct.mklocalworkdir('workdir'))
def localworkdir(self): return hct.mklocalworkdir(self._tr.workdir)
def test_localworkdir_jobid(self): with patch('hod.config.template._current_user', return_value='username'): with patch('os.getpid', return_value='123'): with patch('socket.getfqdn', return_value='hostname'): with patch('os.getenv', return_value='jobid'): self.assertEqual('workdir/hod/jobid/username.hostname.123', hct.mklocalworkdir('workdir'))