Exemplo n.º 1
0
 def test_get_ssh_dir(self):
     config = {}
     username = getpwuid(os.geteuid()).pw_name
     sshdir = os.path.join(getpwuid(os.geteuid()).pw_dir, '.ssh')
     if not os.path.isdir(sshdir):
         sshdir = None
     result = get_ssh_dir(config, username)
     self.assertEqual(result, sshdir)
Exemplo n.º 2
0
 def test_get_ssh_dir(self):
     config = {}
     username = getpwuid(os.geteuid()).pw_name
     sshdir = os.path.join(getpwuid(os.geteuid()).pw_dir, '.ssh')
     if not os.path.isdir(sshdir):
         sshdir = None
     result = get_ssh_dir(config, username)
     self.assertEqual(result, sshdir)
Exemplo n.º 3
0
 def test_get_ssh_dir_pwn(self, mock_isdir):
     config = {}
     mock_isdir.return_value = False
     username = getpwuid(os.geteuid()).pw_name
     sshdir = os.path.join(getpwuid(os.geteuid()).pw_dir, '.ssh')
     if not os.path.isdir(sshdir):
         sshdir = None
     result = get_ssh_dir(config, username)
     self.assertEqual(result, sshdir)
Exemplo n.º 4
0
 def test_get_ssh_dir_pwn(self, mock_isdir):
     config = {}
     mock_isdir.return_value = False
     username = getpwuid(os.geteuid()).pw_name
     sshdir = os.path.join(getpwuid(os.geteuid()).pw_dir, '.ssh')
     if not os.path.isdir(sshdir):
         sshdir = None
     result = get_ssh_dir(config, username)
     self.assertEqual(result, sshdir)