diff --git a/.travis.yml b/.travis.yml index d62426155..f6565c95d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,12 @@ python: env: matrix: - BOTO_VERSION=2.34.0 - - BOTO_VERSION=2.32.1 - BOTO_VERSION=2.25.0 - BOTO_VERSION=2.7 matrix: include: - python: "3.3" - env: BOTO_VERSION=2.32.1 + env: BOTO_VERSION=2.32.4 install: - pip install boto==$BOTO_VERSION - pip install . diff --git a/moto/dynamodb/models.py b/moto/dynamodb/models.py index 27a2cea5a..4251445d4 100644 --- a/moto/dynamodb/models.py +++ b/moto/dynamodb/models.py @@ -153,6 +153,9 @@ class Table(object): def __nonzero__(self): return True + def __bool__(self): + return self.__nonzero__() + def put_item(self, item_attrs): hash_value = DynamoType(item_attrs.get(self.hash_key_attr)) if self.has_range_key: diff --git a/moto/dynamodb/responses.py b/moto/dynamodb/responses.py index 2e1665292..533657668 100644 --- a/moto/dynamodb/responses.py +++ b/moto/dynamodb/responses.py @@ -159,8 +159,8 @@ class DynamoHandler(BaseResponse): for table_name, table_requests in table_batches.items(): for table_request in table_requests: - request_type = table_request.keys()[0] - request = table_request.values()[0] + request_type = list(table_request)[0] + request = list(table_request.values())[0] if request_type == 'PutRequest': item = request['Item']