From 997177e43ec9a5d65bd7033a8553ee5d6d07f0c2 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Wed, 23 Oct 2019 02:26:26 -0700 Subject: [PATCH] #847 - Fix tests to be compatible with python3 --- tests/test_dynamodb2/test_dynamodb.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_dynamodb2/test_dynamodb.py b/tests/test_dynamodb2/test_dynamodb.py index a2b97ff08..ca8a7c935 100644 --- a/tests/test_dynamodb2/test_dynamodb.py +++ b/tests/test_dynamodb2/test_dynamodb.py @@ -1323,7 +1323,7 @@ def test_bad_scan_filter(): except ClientError as err: err.response['Error']['Code'].should.equal('ValidationError') else: - raise RuntimeError('Should of raised ResourceInUseException') + raise RuntimeError('Should have raised ResourceInUseException') @mock_dynamodb2 @@ -1375,7 +1375,7 @@ def test_duplicate_create(): except ClientError as err: err.response['Error']['Code'].should.equal('ResourceInUseException') else: - raise RuntimeError('Should of raised ResourceInUseException') + raise RuntimeError('Should have raised ResourceInUseException') @mock_dynamodb2 @@ -1400,7 +1400,7 @@ def test_delete_table(): except ClientError as err: err.response['Error']['Code'].should.equal('ResourceNotFoundException') else: - raise RuntimeError('Should of raised ResourceNotFoundException') + raise RuntimeError('Should have raised ResourceNotFoundException') @mock_dynamodb2 @@ -2832,9 +2832,8 @@ def test_update_catches_invalid_list_append_operation(): ExpressionAttributeValues={':i': [{'S': 'bar2'}]}) # Verify correct error is returned - ex.exception.message.should.equal("Parameter validation failed:\n" - "Invalid type for parameter ExpressionAttributeValues." - ":i, value: [{u'S': u'bar2'}], type: , valid types: ") + str(ex.exception).should.match("Parameter validation failed:") + str(ex.exception).should.match("Invalid type for parameter ExpressionAttributeValues.") def _create_user_table():