Techdebt: Sure - Documentation (#6051)
This commit is contained in:
parent
1934d24ad5
commit
bb60ea3594
@ -17,9 +17,9 @@ When writing negative tests, try to use the following format:
|
||||
with pytest.raises(botocore.exceptions.ClientError) as exc:
|
||||
client.failing_call(..)
|
||||
err = exc.value.response["Error"]
|
||||
# These assertions use the 'sure' library, but any assertion style is accepted
|
||||
err["Code"].should.equal(..)
|
||||
err["Message"].should.equal(..)
|
||||
# Use the pytest assert method, see https://docs.pytest.org/en/stable/how-to/assert.html#
|
||||
assert err["Code"] == ..
|
||||
assert err["Message"] == ..
|
||||
|
||||
This is the best way to ensure that exceptions are dealt with correctly by Moto.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user