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'))
Esempio n. 2
0
 def localworkdir(self):
     return hct.mklocalworkdir(self._tr.workdir)
Esempio n. 3
0
 def localworkdir(self):
     return hct.mklocalworkdir(self._tr.workdir)
Esempio n. 4
0
 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'))