Multiline string improvements #425

Open
mattupstate opened this Issue Jan 23, 2014 · 3 comments

3 participants

@mattupstate

I'm really enjoying lettuce. I'm using it to test a hypermedia API project built with Flask. The integration has been very smooth. However, I'm wondering if there is some way to improve the multiline strings feature that does not require lots of double quotes. Here's an example scenario:

Scenario: Creating a User
  Given an access token with global scope
  When I make a POST request to "/users" with the body:
  """
  "  {                                "
  "    "email": "joe@somewhere.com",  "
  "    "password": "password"         "
  "  }                                "
  """
  Then I should get a 201 status code

The JSON data is very annoying to manage with all the double quotes required by JSON documents and by lettuce to support the multiline string. It would be awesome if I could just write is as such:

Scenario: Creating a User
  Given an access token with global scope
  When I make a POST request to "/users" with the body:
  """
  {
    "email": "joe@somewhere.com",
    "password": "password"
  }
  """
  Then I should get a 201 status code

Cheers!

@adaschevici
Collaborator

@mattupstate
Hi. Thanks for the suggestion. We are working on a rewrite of the parsing method using a more robust structure. We will throw your suggestion in and solve some of the other issues in the process hopefully.

@mattupstate

@adaschevici Awesome. Looking forward to any improvements!

@danni
Collaborator

Yep, this is fixed in the new-parser branch (#429). Needs some tests though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment