Skip to content

Commit 8446cde

Browse files
saifaldin14Saif Al-Din AliCopilot
authored
Add cli fixes (#1)
* Create extension * Update src/migrate/azext_migrate/__init__.py Co-authored-by: Copilot <[email protected]> * Fix import issues * Update src/migrate/setup.py Co-authored-by: Copilot <[email protected]> * Small * Small lint * Small * disable lint for this check * Add json * Fix licesnse issue * fix small * Small * Get rid of unused variables * Add service name and code owner * New version * Style * Small * Update * Follow standard * Add suggestions * Small * Not preview * Add flag to become experimental * Update history * Fix * small * Create get job and remove replication commands * Add better error handling for jobs command * Add better messages to remove protected item * Return job id in remove command * Move helpers * Rename get discovered server helper * Refactor _initialize_replication_infrastructure_helpers * Refactor new replication * Refactor jobs * Refactor delete protected item * Fix lint issues * Change release version * Fix lint issues * Add fix * Updae correct version * Put beta version before * Fix * Update * Fix bifurcation tool issue * Update amh correctly if not proper * Use current subscription id if not passed in * Fix correct location and target resource group creation * Create list protected items command * Update versions * Add __init__.py to all folders * Create unit tests for get replication * Update readme with accurate description of commands * Update readme * Create tests for jobs and remove commands * Add more tests to increase coverage to 74% * Add start migration command * Address fixes * Remove doc strings from custom.py * Add init * Remove old file locations * fix failing tests * Fix secret test * Fix test * Fix secret detection * Fix duplicates --------- Co-authored-by: Saif Al-Din Ali <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 6bfea6b commit 8446cde

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/migrate/azext_migrate/tests/latest/test_migrate_commands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ def mock_format(job):
19581958
return job
19591959

19601960
mock_cmd = mock.Mock()
1961-
mock_cmd.cli_ctx.cloud.endpoints.resource_manager = "https://management.azure.com"
1961+
mock_cmd.cli_ctx.cloud.endpoints.resource_manager = "mock-endpoint"
19621962

19631963
# Execute - should raise error
19641964
with self.assertRaises((CLIError, KnackCLIError)) as context:
@@ -1990,7 +1990,7 @@ def mock_format(job):
19901990
return {'name': job['name']}
19911991

19921992
mock_cmd = mock.Mock()
1993-
mock_cmd.cli_ctx.cloud.endpoints.resource_manager = "https://management.azure.com"
1993+
mock_cmd.cli_ctx.cloud.endpoints.resource_manager = 'mock-endpoint'
19941994

19951995
# Execute
19961996
result = list_all_jobs(
@@ -2474,7 +2474,7 @@ def test_parse_protected_item_id_invalid_format(self):
24742474

24752475
self.assertIn('Invalid target object ID format', str(context.exception))
24762476

2477-
def test_parse_protected_item_id_empty(self):
2477+
def test_parse_protected_item_id_empty_for_remove(self):
24782478
"""Test parsing empty protected item ID."""
24792479
from azext_migrate.helpers.replication.remove._parse import parse_protected_item_id
24802480

@@ -4313,7 +4313,7 @@ def test_parse_job_id_empty(self):
43134313
parse_job_id("")
43144314

43154315
@mock.patch('azext_migrate.helpers._utils.get_resource_by_id')
4316-
def test_get_vault_name_from_project_success(self, mock_get_resource):
4316+
def test_get_vault_name_from_project_success_for_job(self, mock_get_resource):
43174317
"""Test successfully getting vault name from project."""
43184318
from azext_migrate.helpers.replication.job._parse import get_vault_name_from_project
43194319

@@ -5234,7 +5234,7 @@ def test_parse_protected_item_id_invalid(self):
52345234

52355235
self.assertIn("Invalid protected item ID format", str(context.exception))
52365236

5237-
def test_parse_protected_item_id_empty(self):
5237+
def test_parse_protected_item_id_empty_for_migration(self):
52385238
"""Test parsing an empty protected item ID"""
52395239
from azext_migrate.helpers.migration.start._parse import (
52405240
parse_protected_item_id
@@ -5612,7 +5612,7 @@ def test_validate_arc_resource_bridge_not_found_warning(self, mock_send_request)
56125612
# Should complete without exception
56135613

56145614
@mock.patch('azext_migrate.helpers._utils.get_resource_by_id')
5615-
def test_get_vault_name_from_project_success(self, mock_get_resource):
5615+
def test_get_vault_name_from_project_success_for_migration(self, mock_get_resource):
56165616
"""Test successfully retrieving vault name from project"""
56175617
from azext_migrate.helpers.replication.job._parse import (
56185618
get_vault_name_from_project

0 commit comments

Comments
 (0)