You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+49-26Lines changed: 49 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -132,36 +132,57 @@ ALLOWED_QUERY_PARAMS = {
132
132
}
133
133
```
134
134
135
-
If the endpoint has a key that uses an **Array**, you will need to check the **_choices** of the application the endpoint is in and build those into **netbox_utils** module util.
135
+
If the endpoint has a key that uses an **Array**, you will need to add the endpoint to **REQUIRED_ID_FIND** and the key that will need to be converted. The lookup is done from the endpoint and pulls the choices from the API.
If the key is something that pertains to a different endpoint such as **manufacturer** it will need to be added to a few variables within **netbox_utils**.
@@ -259,7 +280,7 @@ Copying an existing module that has close to the same options is typically the p
259
280
260
281
#### Testing
261
282
262
-
- Please update `tests/unit/module_utils/test_netbox_base_class.py` if editing anything within the base class that needs to be tested. This will most likely be needed as there are a few unit tests that test the data of **ALLOWED_QUERY_PARAMS**, etc.
283
+
- Please update any associated data within the `tests/unit/module_utils/test_data/` folders for the specified tests. This will most likely be needed as there are a few unit tests that test the data of **ALLOWED_QUERY_PARAMS**, etc.
263
284
264
285
```python
265
286
def test_normalize_data_returns_correct_data()
@@ -269,7 +290,9 @@ Copying an existing module that has close to the same options is typically the p
269
290
def test_build_query_params_child()
270
291
```
271
292
293
+
- Check each test above to see which `test_data` it uses and edit the corresponding data.json file
272
294
- Please add or update an existing play to test the new Netbox module for integration testing within `tests/integration/integration-tests.yml`. Make sure to test creation, duplicate, update (if possible), and deletion along with any other conditions that may want to be tested.
295
+
- Run `pytest -vv` to make sure all unit tests pass
273
296
- Run `black .` within the base directory for black formatting as it's required for tests to pass
274
297
- Run `ansible-lint integration-tests.yml` it's required for tests to pass
275
298
- Check necessary dependencies defined within `.travis.yml` for now if you're wanting to test locally
0 commit comments