Skip to content

Conversation

@nights99
Copy link
Owner

Fixes and modernizes unit tests:\n\n- Update internal/lib tests to match current signatures and XML emission.\n- Re-enable and rewrite internal/xmlstore tests to use yang.Modules and assert on marshaled XML.\n- Keep internal/transports/transport_websocket_test.go ignored (integration-style) to avoid CI flakes.\n\nAll changes are test-only; no production code modified. Please review the test diffs and let me know if you want the websocket test refactored into a unit test.

google-labs-jules bot and others added 3 commits May 24, 2025 14:29
This commit introduces unit tests for several key packages:

- internal/lib: Added table-driven tests for `newNetconfRequest`, `emitNestedXML`, and `netconfRequest.MarshalXML` in `netconf_lib_test.go`.
- internal/transports: Updated `transport_websocket_test.go` by removing the `//go:build exclude` tag, correcting the package name to `transports`, and skipping the `TestWS` function which requires a live server and WASM environment. The skip message provides context.
- internal/xmlstore: Added comprehensive table-driven tests in `xmlstore_test.go` for `XMLStore.Insert`, `XMLStore.Marshal`, and the custom `xmlElement.MarshalXML` method, including mocking of `yang.Entry` for thoroughness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants