def test_construct_keypair(Keypair: Mock): public_key_path = 'test-public_key_path' private_key_path = 'test-private_key_path' passphrase = 'test-passphrase' construct_keypair(public_key_path, private_key_path, passphrase) Keypair.assert_called_once_with('git', public_key_path, private_key_path, passphrase)
def _fetch_remote_template(self): # First try to pull it from the remote origin/TEMPLATE_BRANCH keypair = construct_keypair() self.repo.remotes['origin'].fetch( [TEMPLATE_BRANCH], callbacks=RemoteCallbacks(credentials=keypair)) self.repo.references.create( f'refs/heads/{TEMPLATE_BRANCH}', self.repo.references.get( f'refs/remotes/origin/{TEMPLATE_BRANCH}').target)
def test_construct_keypair_defaults(Keypair: Mock): construct_keypair() user_home = os.path.expanduser('~') Keypair.assert_called_once_with('git', f'{user_home}/.ssh/id_rsa.pub', f'{user_home}/.ssh/id_rsa', '')