DMS: Fix TableMappings and ReplicationTaskSettings format. (#6396)
This commit is contained in:
parent
3741058242
commit
1c8d1aec2e
@ -1,5 +1,3 @@
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Iterable, Optional
|
||||
from moto.core import BaseBackend, BackendDict, BaseModel
|
||||
@ -142,8 +140,8 @@ class FakeReplicationTask(BaseModel):
|
||||
"TargetEndpointArn": self.target_endpoint_arn,
|
||||
"ReplicationInstanceArn": self.replication_instance_arn,
|
||||
"MigrationType": self.migration_type,
|
||||
"TableMappings": json.dumps(self.table_mappings),
|
||||
"ReplicationTaskSettings": json.dumps(self.replication_task_settings),
|
||||
"TableMappings": self.table_mappings,
|
||||
"ReplicationTaskSettings": self.replication_task_settings,
|
||||
"Status": self.status,
|
||||
"ReplicationTaskCreationDate": self.creation_date.isoformat(),
|
||||
"ReplicationTaskStartDate": start_date,
|
||||
|
@ -2,6 +2,7 @@ from botocore.exceptions import ClientError
|
||||
import boto3
|
||||
import sure # noqa # pylint: disable=unused-import
|
||||
import pytest
|
||||
import json
|
||||
|
||||
from moto import mock_dms
|
||||
|
||||
@ -17,6 +18,7 @@ def test_create_and_get_replication_task():
|
||||
ReplicationInstanceArn="replication-instance-arn",
|
||||
MigrationType="full-load",
|
||||
TableMappings='{"rules":[]}',
|
||||
ReplicationTaskSettings='{"Logging":{} }',
|
||||
)
|
||||
|
||||
tasks = client.describe_replication_tasks(
|
||||
@ -31,6 +33,11 @@ def test_create_and_get_replication_task():
|
||||
task["ReplicationInstanceArn"].should.equal("replication-instance-arn")
|
||||
task["MigrationType"].should.equal("full-load")
|
||||
task["Status"].should.equal("creating")
|
||||
task["TableMappings"].should.equal('{"rules":[]}')
|
||||
json.loads(task["TableMappings"]).should.be.a(dict)
|
||||
|
||||
task["ReplicationTaskSettings"].should.equal('{"Logging":{} }')
|
||||
json.loads(task["ReplicationTaskSettings"]).should.be.a(dict)
|
||||
|
||||
|
||||
@mock_dms
|
||||
|
Loading…
Reference in New Issue
Block a user