Example #1
0
    def test_create_table_saves_schema(self, m_store):
        from ddbmock.database.db import dynamodb

        data = {
            "TableName": TABLE_NAME2,
            "KeySchema": [HASH_KEY],
            "ProvisionedThroughput": {
                "ReadCapacityUnits": TABLE_RT,
                "WriteCapacityUnits": TABLE_WT,
            }
        }

        dynamodb.create_table(TABLE_NAME2, data)

        m_store.__setitem__.assert_called_with(
                                               (TABLE_NAME2, False),
                                               dynamodb.data[TABLE_NAME2],
                                              )
Example #2
0
    def test_create_table_saves_schema(self, m_store):
        from ddbmock.database.db import dynamodb

        data = {
            "TableName": TABLE_NAME2,
            "KeySchema": {
                "HashKeyElement": HASH_KEY,
                "RangeKeyElement": RANGE_KEY,
            },
            "ProvisionedThroughput": {
                "ReadCapacityUnits": TABLE_RT,
                "WriteCapacityUnits": TABLE_WT,
            }
        }

        dynamodb.create_table(TABLE_NAME2, data)

        m_store.__setitem__.assert_called_with(
            (TABLE_NAME2, False),
            dynamodb.data[TABLE_NAME2],
        )
Example #3
0
def create_table(post):
    table = dynamodb.create_table(post[u"TableName"], post)

    return {"TableDescription": table.to_dict(verbose=False)}
Example #4
0
def create_table(post):
    table = dynamodb.create_table(post[u'TableName'], post)

    return {
        "TableDescription": table.to_dict(verbose=False),
    }