/ tests / sam-test-infrastructure / src / sam_test_infrastructure / test_data / web_content / README.md
README.md
1 # Test Data for Web Content Testing 2 3 This directory contains static test files used by the `TestStaticFileServer` for integration testing of the `web_request` tool. 4 5 ## Files 6 7 - **sample.json** - JSON data structure for testing `application/json` content type 8 - **sample.html** - HTML document for testing `text/html` content type 9 - **sample.txt** - Plain text file for testing `text/plain` content type 10 - **sample.xml** - XML document for testing `application/xml` content type 11 - **sample.csv** - CSV data for testing `text/csv` content type 12 - **large_file.bin** - Binary file for testing large response handling 13 14 ## Usage 15 16 These files are served by `TestStaticFileServer` during integration tests. The server runs on `http://localhost:8089` by default. 17 18 The server supports both GET and POST requests: 19 - GET requests serve static files from this directory 20 - POST requests return a default 201 Created response (or configured responses for testing) 21 22 Example URLs: 23 - `http://localhost:8089/sample.json` (GET) 24 - `http://localhost:8089/sample.html` (GET) 25 - `http://localhost:8089/posts` (POST) 26 27 ## Adding New Test Files 28 29 1. Add the file to this directory 30 2. The server will automatically serve it with the appropriate content type based on the file extension 31 3. Update this README to document the new file 32 33 ## Content Types 34 35 The server automatically determines content types based on file extensions: 36 37 | Extension | Content Type | 38 |-----------|--------------| 39 | .json | application/json | 40 | .html, .htm | text/html | 41 | .txt | text/plain | 42 | .xml | application/xml | 43 | .csv | text/csv | 44 | .png | image/png | 45 | .jpg, .jpeg | image/jpeg | 46 | .gif | image/gif | 47 | .pdf | application/pdf | 48 | .zip | application/zip |