Skip to content

Test: embedding tests out of sync with current API behavior #34

@rajjaa-hr

Description

@rajjaa-hr

Summary

Two embedding tests in tests/test_text.py no longer match the current API behavior:

1. `test_embedding_basic` (tests/test_text.py:55)

Sends a text to `/text/embedding` without an `algorithm_key`. Expects 200, now gets:
```
400 Bad request. Algorithm key is required.
```
The backend now requires an algorithm key on this endpoint. The test needs to pass one (and a matching env var).

2. `test_embedding_no_text` (tests/test_text.py:66)

Asserts the 400 error message contains the substring `null`, but the API now returns:
```
Bad request. Texts cannot be empty
```
The assertion needs updating.

Suggested fix

  • Add `HRFLOW_ALGORITHM_KEY_EMBEDDING` (or reuse an existing one) and pass it into `test_embedding_basic`.
  • Update `test_embedding_no_text` to assert on a substring that matches the current message (e.g. `empty` or `cannot`), or ideally assert on a structured error code if the API exposes one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions