MarketSquare / MarketSquare/robotframework-requests

Pass a list as expected_status

Open
#322 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
512
Forks
283
PR merge metrics
No merged PRs in 30d

Description

When targeting GET on a URI if its not found / internal server error results in exception HTTPError , I can use the expected_status to override it however, it would be great if that accepts multiple values

expected_status=400,500,200

Other use cases like where example,

GET On Session  /xyz/somepath/uri   expected_status=xxx

it would raise the HTTPError if expected_status is not used and errors out

if the expected state mismatched, it raise exception as well

Url: https://xx.xx.xx.xx:443/xyz/openbmc_project/dump/ Expected status: 200 != 404

we would love to have the response than handle the exception in robot caller test code/scripts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how expected_status is handled by the GET and Session keywords described in the issue, then inspect the existing HTTPError behavior. Add coverage for multiple accepted statuses, ensuring matching responses are returned and mismatches still raise the expected exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.