fix: improve Azure DevOps PR URL parsing and add unit tests

This commit is contained in:
mrT23
2024-09-10 08:19:22 +03:00
parent 25ad8a09ce
commit e444da8378
2 changed files with 25 additions and 8 deletions

View File

@ -0,0 +1,15 @@
from pr_agent.git_providers import AzureDevopsProvider
class TestAzureDevOpsParsing():
def test_regular_address(self):
pr_url = "https://dev.azure.com/organization/project/_git/repo/pullrequest/1"
# workspace_slug, repo_slug, pr_number
assert AzureDevopsProvider._parse_pr_url(pr_url) == ("project", "repo", 1)
def test_visualstudio_address(self):
pr_url = "https://organization.visualstudio.com/project/_git/repo/pullrequest/1"
# workspace_slug, repo_slug, pr_number
assert AzureDevopsProvider._parse_pr_url(pr_url) == ("project", "repo", 1)