Exemplo n.º 1
0
    def setup(self):
        self.mocks = [mock_dynamodb2(), mock_dynamodbstreams()]
        for m in self.mocks:
            m.start()

        # create a table with a stream
        conn = boto3.client("dynamodb", region_name="us-east-1")

        resp = conn.create_table(
            TableName="test-streams",
            KeySchema=[{
                "AttributeName": "id",
                "KeyType": "HASH"
            }],
            AttributeDefinitions=[{
                "AttributeName": "id",
                "AttributeType": "S"
            }],
            ProvisionedThroughput={
                "ReadCapacityUnits": 1,
                "WriteCapacityUnits": 1
            },
            StreamSpecification={
                "StreamEnabled": True,
                "StreamViewType": "NEW_AND_OLD_IMAGES",
            },
        )
        self.stream_arn = resp["TableDescription"]["LatestStreamArn"]
Exemplo n.º 2
0
    def setup(self):
        self.mocks = [mock_dynamodb2(), mock_dynamodbstreams()]
        for m in self.mocks:
            m.start()

        # create a table with a stream
        conn = boto3.client('dynamodb', region_name='us-east-1')

        resp = conn.create_table(TableName='test-streams',
                                 KeySchema=[{
                                     'AttributeName': 'id',
                                     'KeyType': 'HASH'
                                 }],
                                 AttributeDefinitions=[{
                                     'AttributeName': 'id',
                                     'AttributeType': 'S'
                                 }],
                                 ProvisionedThroughput={
                                     'ReadCapacityUnits': 1,
                                     'WriteCapacityUnits': 1
                                 },
                                 StreamSpecification={
                                     'StreamEnabled': True,
                                     'StreamViewType': 'NEW_AND_OLD_IMAGES'
                                 })
        self.stream_arn = resp['TableDescription']['LatestStreamArn']
Exemplo n.º 3
0
    def setup(self):
        self.mocks = [mock_dynamodb2(), mock_dynamodbstreams()]
        for m in self.mocks:
            m.start()
            
        # create a table with a stream
        conn = boto3.client('dynamodb', region_name='us-east-1')

        resp = conn.create_table(
            TableName='test-streams',
            KeySchema=[{'AttributeName': 'id', 'KeyType': 'HASH'}],
            AttributeDefinitions=[{'AttributeName': 'id',
                                   'AttributeType': 'S'}],
            ProvisionedThroughput={'ReadCapacityUnits': 1,
                                   'WriteCapacityUnits': 1},
            StreamSpecification={
                'StreamEnabled': True,
                'StreamViewType': 'NEW_AND_OLD_IMAGES'
            }
        )
        self.stream_arn = resp['TableDescription']['LatestStreamArn']
Exemplo n.º 4
0
 def setup(self):
     self.mocks = [mock_dynamodb2(), mock_dynamodbstreams()]
     for m in self.mocks:
         m.start()
Exemplo n.º 5
0
 def setup(self):
     self.mocks = [mock_dynamodb2(), mock_dynamodbstreams()]
     for m in self.mocks:
         m.start()