jctophefabre / rejocker

REst Json mOCK servER
Apache License 2.0
0 stars 1 forks source link

Problem with parameters passed in URL #1

Open Arthoni opened 4 years ago

Arthoni commented 4 years ago

Example: current tests want to reach /news without and with params: /news?lang=fr and /news?lang=grd (this last one supposed to return an error) But even with separated lines in the .json file

{
        "path" : "/news",
        "get" : {
          "returned": {
            "body" : "<rss version=\"2.0\">News\n</rss>" } } 
},
{
        "path" : "/news?lang=fr",
        "get" : {
          "returned": {
            "body" : "<rss version=\"2.0\">Nouvelles\n</rss>" } } 
}

the reached endpoint for every test is /news and ignores parameters, I assume that the arguments are digested by flask.

And since the arguments redirect to the same endpoint, how can we handle tests aiming to an identical endpoint + method with different parameters ? This is the same question than testing an endpoint with different payloads.

jctophefabre commented 4 years ago

Thanks for the issue. In my opinion, the best solution is to introduce a new functionality with parameters/values in the expected set description. We will discuss about it.