This commit is contained in:
zmsmith 2013-02-19 19:38:33 -05:00
parent 5086e6e590
commit 81547e1bc5
2 changed files with 7 additions and 5 deletions

View File

@ -1,11 +1,12 @@
from moto.core import BaseBackend
class DynamoDBBackend(BaseBackend):
def __init__(self):
self.tables = {}
def create_table(self, name):
self.tables[name] = None
dynamodb_backend = DynamoDBBackend()
dynamodb_backend = DynamoDBBackend()

View File

@ -2,8 +2,9 @@ import re
import json
from .models import dynamodb_backend
class DynamoHandler(object):
def __init__(self, uri, body, headers):
self.uri = uri
self.body = body
@ -26,7 +27,7 @@ class DynamoHandler(object):
tables = dynamodb_backend.tables.keys()
response = {"TableNames": tables}
return json.dumps(response)
def handler(uri, body, headers):
return DynamoHandler(uri, body, headers).dispatch()
return DynamoHandler(uri, body, headers).dispatch()