Example #1
0
    def _getenv():
        """Generate environment for process execution."""
        env = {'GIT_SSH': get_wrapper_filename()}

        # Add path to config if it exists
        userconfig = os.path.expanduser('~/.config/hub')
        if os.path.exists(userconfig):
            env['HUB_CONFIG'] = userconfig

        return get_clean_env(env)
Example #2
0
    def _getenv():
        """Generate environment for process execution."""
        env = {'GIT_SSH': get_wrapper_filename()}

        # Add path to config if it exists
        userconfig = os.path.expanduser('~/.config/hub')
        if os.path.exists(userconfig):
            env['HUB_CONFIG'] = userconfig

        return get_clean_env(env)
Example #3
0
 def test_create_ssh_wrapper(self):
     self.assertEqual(check_data_writable(), [])
     filename = get_wrapper_filename()
     create_ssh_wrapper()
     with open(filename, 'r') as handle:
         data = handle.read()
         self.assertTrue(ssh_file('known_hosts') in data)
         self.assertTrue(ssh_file('id_rsa') in data)
         self.assertTrue(settings.DATA_DIR in data)
     self.assertTrue(os.access(filename, os.X_OK))
     # Second run should not touch the file
     timestamp = os.stat(filename).st_mtime
     create_ssh_wrapper()
     self.assertEqual(timestamp, os.stat(filename).st_mtime)
Example #4
0
 def test_create_ssh_wrapper(self):
     check_data_writable()
     filename = get_wrapper_filename()
     create_ssh_wrapper()
     with open(filename, 'r') as handle:
         data = handle.read()
         self.assertTrue(ssh_file('known_hosts') in data)
         self.assertTrue(ssh_file('id_rsa') in data)
         self.assertTrue(settings.DATA_DIR in data)
     self.assertTrue(
         os.access(filename, os.X_OK)
     )
     # Second run should not touch the file
     timestamp = os.stat(filename).st_mtime
     create_ssh_wrapper()
     self.assertEqual(timestamp, os.stat(filename).st_mtime)
Example #5
0
 def check_config(self):
     """Check VCS configuration."""
     # We directly set config as it takes same time as reading it
     self.set_config('ui.ssh', get_wrapper_filename())
Example #6
0
 def _getenv():
     """Generate environment for process execution."""
     return get_clean_env({'GIT_SSH': get_wrapper_filename()})
Example #7
0
 def _getenv():
     """Generate environment for process execution."""
     return get_clean_env({'GIT_SSH': get_wrapper_filename()})
Example #8
0
 def check_config(self):
     """Check VCS configuration."""
     # We directly set config as it takes same time as reading it
     self.set_config('ui.ssh', get_wrapper_filename())