Fix failure of scan() after has_item()

Fixes #731
This commit is contained in:
Helen Sherwood-Taylor 2016-10-25 17:09:39 +01:00
commit 08d07fed30
3 changed files with 23 additions and 1 deletions

View file

@ -419,6 +419,17 @@ def test_scan_with_undeclared_table():
).should.throw(DynamoDBResponseError)
@mock_dynamodb
def test_scan_after_has_item():
conn = boto.connect_dynamodb()
table = create_table(conn)
list(table.scan()).should.equal([])
table.has_item(hash_key='the-key', range_key='123')
list(table.scan()).should.equal([])
@mock_dynamodb
def test_write_batch():
conn = boto.connect_dynamodb()

View file

@ -335,6 +335,17 @@ def test_scan_with_undeclared_table():
).should.throw(DynamoDBResponseError)
@mock_dynamodb
def test_scan_after_has_item():
conn = boto.connect_dynamodb()
table = create_table(conn)
list(table.scan()).should.equal([])
table.has_item('the-key')
list(table.scan()).should.equal([])
@mock_dynamodb
def test_write_batch():
conn = boto.connect_dynamodb()