Skip to content

Commit 2dac25f

Browse files
Fede Kamelharfede-kamel
authored andcommitted
docs:Improve the contributing.md for testing purposes
docs:Improve the contributing.md for testing purposes
1 parent 4022488 commit 2dac25f

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,46 @@ Then to install:
8383
$ pip install ./path-to-wheel-file.whl
8484
```
8585

86-
## Running tests
86+
## Running Tests
8787

88-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
88+
Most tests require a mock server to be set up against the OpenAPI specification. Follow these steps to get your test environment ready:
89+
90+
### Setup Instructions
91+
92+
### 1. Download the OpenAPI Specification
93+
94+
First, locate the latest valid OpenAPI specification URL in `.stats.yml` and download it:
95+
96+
```sh
97+
# Download the openapi_spec_url from .stats.yml (use the latest valid version)
98+
curl -o openapi.yml [URL_FROM_STATS_YML]
99+
```
100+
101+
### 2. Copy the Specification File
102+
103+
Move the downloaded OpenAPI specification to the main project directory:
89104

90105
```sh
91-
# you will need npm installed
92-
$ npx prism mock path/to/your/openapi.yml
106+
cp openapi.yml path/to/anthropic-sdk-python/
93107
```
94108

109+
### 3. Start the Mock Server
110+
111+
Use [Prism](https://github.com/stoplightio/prism) to create a mock server from the OpenAPI specification:
112+
113+
```sh
114+
# Ensure you have npm installed, then run:
115+
npx prism mock openapi.yml
116+
```
117+
118+
The mock server will start and provide endpoints based on your OpenAPI specification.
119+
120+
### 4. Run Tests
121+
122+
With the mock server running, execute the test suite:
123+
95124
```sh
96-
$ ./scripts/test
125+
./scripts/test
97126
```
98127

99128
## Linting and formatting

0 commit comments

Comments
 (0)