From 6471cc15a7baa3cc02622f9e0c353522426fa3c0 Mon Sep 17 00:00:00 2001 From: "Renuka Mohan Channapatna (rchannap)" <17580723+renukavinay@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:27:06 -0700 Subject: [PATCH 1/2] updated payload --- vmngclient/model/tenant.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmngclient/model/tenant.py b/vmngclient/model/tenant.py index 933775514..5d3464a61 100644 --- a/vmngclient/model/tenant.py +++ b/vmngclient/model/tenant.py @@ -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") From e16d05696efe62df40442f6edc55e1abf63f741a Mon Sep 17 00:00:00 2001 From: "Renuka Mohan Channapatna (rchannap)" <17580723+renukavinay@users.noreply.github.com> Date: Sat, 16 Sep 2023 00:16:59 -0700 Subject: [PATCH 2/2] unit test->MigrationTenant --- vmngclient/tests/test_tenant_migration_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vmngclient/tests/test_tenant_migration_api.py b/vmngclient/tests/test_tenant_migration_api.py index b20355868..610220dfd 100644 --- a/vmngclient/tests/test_tenant_migration_api.py +++ b/vmngclient/tests/test_tenant_migration_api.py @@ -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): @@ -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: