Ejemplo n.º 1
0
 def test_get_vsts_inf_new_url_format_with_ssh(self):
     with patch(
             'azext_devops.vstsCompressed.git.v4_1.git_client.GitClient.get_vsts_info_by_remote_url'
     ) as mock_get_vsts_info:
         with patch('azext_devops.dev.common.services._get_credentials'
                    ) as mock_get_creds:
             VstsGitUrlInfo.get_vsts_info(
                 '[email protected]:v3/organization/project/repository')
             # Asserts
             mock_get_vsts_info.assert_called_once()
             mock_get_creds.assert_called_once()
             get_vsts_info_url_param = mock_get_vsts_info.call_args_list[0][
                 0]
             self.assertEqual(
                 'https://dev.azure.com/organization/project/_git/repository'
                 .lower(), get_vsts_info_url_param[0])
Ejemplo n.º 2
0
 def test_get_vsts_info_old_url_format_with_old_ssh_format(self):
     with patch(
             'vsts.git.v4_1.git_client.GitClient.get_vsts_info_by_remote_url'
     ) as mock_get_vsts_info:
         with patch('azext_devops.dev.common.services._get_credentials'
                    ) as mock_get_creds:
             VstsGitUrlInfo.get_vsts_info(
                 'ssh://[email protected]:22/project/_ssh/repository'
             )
             # Asserts
             mock_get_vsts_info.assert_called_once()
             mock_get_creds.assert_called_once()
             get_vsts_info_url_param = mock_get_vsts_info.call_args_list[0][
                 0]
             self.assertEqual(
                 'https://organization.visualstudio.com/project/_git/repository'
                 .lower(), get_vsts_info_url_param[0])