2021-10-18 19:44:29 +00:00
|
|
|
import sure # noqa # pylint: disable=unused-import
|
2013-12-05 13:16:56 +02:00
|
|
|
|
|
|
|
import moto.server as server
|
|
|
|
|
2019-10-31 08:44:26 -07:00
|
|
|
"""
|
2013-12-05 13:16:56 +02:00
|
|
|
Test the different server responses
|
2019-10-31 08:44:26 -07:00
|
|
|
"""
|
2013-12-05 13:16:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_table_list():
|
2014-01-07 11:17:11 +02:00
|
|
|
backend = server.create_backend_app("dynamodb2")
|
|
|
|
test_client = backend.test_client()
|
2019-10-31 08:44:26 -07:00
|
|
|
res = test_client.get("/")
|
2013-12-05 13:16:56 +02:00
|
|
|
res.status_code.should.equal(404)
|
|
|
|
|
2019-10-31 08:44:26 -07:00
|
|
|
headers = {"X-Amz-Target": "TestTable.ListTables"}
|
|
|
|
res = test_client.get("/", headers=headers)
|
|
|
|
res.data.should.contain(b"TableNames")
|
2021-02-12 08:26:06 -06:00
|
|
|
res.headers.should.have.key("X-Amz-Crc32")
|