Skip to content

Commit 2018ead

Browse files
committed
Add manual testing
1 parent a89d63b commit 2018ead

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,25 @@ server directly:
6161
jupyter server --autoreload
6262
```
6363

64+
### Manual testing
65+
66+
```bash
67+
# Terminal 1.
68+
jupyter server --port 8888 --autoreload --ServerApp.disable_check_xsrf=True --IdentityProvider.token= --ServerApp.port_retries=0
69+
70+
# Terminal 2.
71+
KERNEL=$(curl -X POST http://localhost:8888/api/kernels)
72+
echo $KERNEL
73+
KERNEL_ID=$(echo $KERNEL | jq --raw-output '.id')
74+
echo $KERNEL_ID
75+
REQUEST=$(curl --include http://localhost:8888/api/kernels/$KERNEL_ID/execute -d "{ \"code\": \"print('1+1')\" }")
76+
RESULT=$(echo $REQUEST | grep -i ^Location: | cut -d' ' -f2 | tr -d '\r')
77+
echo $RESULT
78+
79+
curl http://localhost:8888$RESULT
80+
{"status": "ok", "execution_count": 1, "outputs": "[{\"output_type\": \"stream\", \"name\": \"stdout\", \"text\": \"1+1\\n\"}]"}
81+
```
82+
6483
### Running Tests
6584

6685
Install dependencies:
@@ -78,7 +97,7 @@ pytest
7897
pytest jupyter_server_nbmodel/tests/test_handlers.py
7998

8099
# To run a specific test
81-
pytest jupyter_server_nbmodel/tests/test_handlers.py -k "test_get"
100+
pytest jupyter_server_nbmodel/tests/test_handlers.py -k "test_post_execute"
82101
```
83102

84103
### Development uninstall

0 commit comments

Comments
 (0)