Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Migration MT-ST new field is aded in payload for export endpoint 20.13 #369

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vmngclient/model/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ class Tenant(BaseModel):

class Config:
allow_population_by_field_name = True


class MigrationTenant(Tenant):
is_destination_overlay_mt: Optional[bool] = Field(alias="isDestinationOverlayMT")
13 changes: 12 additions & 1 deletion vmngclient/tests/test_tenant_migration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from vmngclient.api.task_status_api import Task
from vmngclient.api.tenant_migration_api import ImportTask, TenantMigrationAPI
from vmngclient.endpoints.tenant_migration import ImportInfo, MigrationInfo
from vmngclient.model.tenant import Tenant
from vmngclient.model.tenant import MigrationTenant, Tenant


class TestTenantMigrationAPI(unittest.TestCase):
Expand All @@ -20,6 +20,17 @@ def test_export_tenant(self):
task = self.api.export_tenant(tenant=tenant)
self.assertIsInstance(task, Task)

def test_export_migration_tenant(self):
tenant = MigrationTenant(
desc="Test Tenant",
name="test_tenant",
subdomain="test_subdomain",
org_name="test_org",
is_destination_overlay_mt=False,
)
task = self.api.export_tenant(tenant=tenant)
self.assertIsInstance(task, Task)

def test_download(self):
content = b"\xFFtest_data"
with tempfile.TemporaryDirectory() as tmpdir:
Expand Down