Co-authored-by: Roshan-sy <roshan-sy@github.com>
This commit is contained in:
Roshan Soni 2021-09-02 13:08:50 +05:30 коммит произвёл GitHub
Родитель 8cb419bdb3
Коммит 61ba68e214
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 470 добавлений и 371 удалений

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -9,7 +9,7 @@ import unittest
from azure_devtools.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable, get_random_name
DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/devops-cli-test-org'
class ReposImportTests(DevopsScenarioTest):
@AllowLargeResponse(size_kb=3072)
@ -22,17 +22,18 @@ class ReposImportTests(DevopsScenarioTest):
try:
#Create a repo with random name
create_repo_command = 'az repos create --detect false --name ' + random_repo_name +' --project ImportRepoTest --output json'
print(DEVOPS_CLI_TEST_ORGANIZATION)
create_repo_command = 'az repos create --detect false --name ' + random_repo_name +' --project TestSupportProject --output json'
repo_create_output = self.cmd(create_repo_command).get_output_in_json()
created_repo_id = repo_create_output["id"]
assert len(created_repo_id) > 0
#Import repo
import_repo_command = 'az repos import create --git-source-url https://dev.azure.com/AzureDevOpsCliTest/ImportRepoTest/_git/snakes-and-ladders --repository ' + created_repo_id + ' --project ImportRepoTest --detect false --output json'
import_repo_command = 'az repos import create --git-source-url https://dev.azure.com/devops-cli-test-org/TestSupportProject/_git/snakes-and-ladders --repository ' + created_repo_id + ' --project TestSupportProject --detect false --output json'
import_repo_output = self.cmd(import_repo_command).get_output_in_json()
import_repo_status = import_repo_output["status"]
assert import_repo_status == 'completed'
list_repo_command = 'az repos list --project ImportRepoTest --output json --detect false'
list_repo_command = 'az repos list --project TestSupportProject --output json --detect false'
verified_repo_list = False
list_repo_output_before_delete = self.cmd(list_repo_command).get_output_in_json()
for repos in list_repo_output_before_delete:
@ -43,8 +44,8 @@ class ReposImportTests(DevopsScenarioTest):
finally:
#TestCleanup - Delete the temporary repo we created for the test
list_repo_command = 'az repos list --project ImportRepoTest --output json --detect false'
delete_repo_command = 'az repos delete --detect false --id ' + created_repo_id + ' --project ImportRepoTest -y --output json'
list_repo_command = 'az repos list --project TestSupportProject --output json --detect false'
delete_repo_command = 'az repos delete --detect false --id ' + created_repo_id + ' --project TestSupportProject -y --output json'
self.cmd(delete_repo_command)
#Verify Deletion