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

Commit

Permalink
Merge pull request #369 from CiscoDevNet/mig_payload
Browse files Browse the repository at this point in the history
Migration MT-ST new field is aded in payload for export endpoint 20.13
  • Loading branch information
renukavinay authored Sep 19, 2023
2 parents df86647 + e16d056 commit ce3b110
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

0 comments on commit ce3b110

Please sign in to comment.