Skip to content

Commit

Permalink
using same coding style everywhere for variables assignement
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentbristiel committed Apr 17, 2014
1 parent ad714bd commit 6a2c8a1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion tests/issues/17.txt
Expand Up @@ -11,6 +11,6 @@ ${JSON_DATA} '{"file":{"path":"/logo1.png"},"token":"some-valid-oauth-token"}'
*** Test Cases ***
Delete Request With Data
Create Session httpbin http://httpbin.org
${headers} Create Dictionary Content-Type application/json
${headers}= Create Dictionary Content-Type application/json
${resp}= Delete httpbin /delete data=${JSON_DATA} headers=${headers}
${jsondata}= To Json ${resp.content}
2 changes: 1 addition & 1 deletion tests/issues/18.txt
Expand Up @@ -11,7 +11,7 @@ ${JSON_DATA} '{"file":{"path":"/logo1.png"},"token":"some-valid-oauth-token"}'
*** Test Cases ***
Encoding Error
Create Session httpbin http://httpbin.org
${headers} Create Dictionary Content-Type application/json
${headers}= Create Dictionary Content-Type application/json
Set Suite Variable ${data} { "elementToken":"token", "matchCriteria":[{"field":"name","dataType":"string","useOr":"false","fieldValue":"Operation check 07", "closeParen": "false", "openParen": "false", "operator": "equalTo"}], "account": { "annualRevenue": "456666", "name": "Account", "numberOfEmployees": "integer", "billingAddress": { "city": "Miami", "country": "US", "countyOrDistrict": "us or fl", "postalCode": "33131", "stateOrProvince": "florida", "street1": "Trade Center", "street2": "North Main rd" }, "number": "432", "industry": "Bank", "type": "string", "shippingAddress": { "city": "denver", "country": "us", "countyOrDistrict": "us or co", "postalCode": "80202", "stateOrProvince": "colorado", "street1": "Main street", "street2": "101 Avenu"}}}

${resp}= Post httpbin /post data=${data} headers=${headers}
Expand Down
8 changes: 4 additions & 4 deletions tests/issues/27.txt
Expand Up @@ -10,11 +10,11 @@ Post Request With XML File
[Tags] post
Create Session httpbin http://httpbin.org

${file_data} Get File ${CURDIR}${/}test.xml
${files} Create Dictionary xml ${file_data}
${headers} Create Dictionary Authorization testing-token
${file_data}= Get File ${CURDIR}${/}test.xml
${files}= Create Dictionary xml ${file_data}
${headers}= Create Dictionary Authorization testing-token
Log ${headers}
${resp} Post httpbin /post files=${files} headers=${headers}
${resp}= Post httpbin /post files=${files} headers=${headers}

${jsondata}= To Json ${resp.content}
Log ${jsondata}
Expand Down
56 changes: 27 additions & 29 deletions tests/testcase.txt
Expand Up @@ -23,27 +23,27 @@ Get Requests
Get Requests with Url Parameters
[Tags] get
Create Session httpbin http://httpbin.org
${params} Create Dictionary key value key2 value2
${resp} Get httpbin /get params=${params}
${params}= Create Dictionary key value key2 value2
${resp}= Get httpbin /get params=${params}
Should Be Equal As Strings ${resp.status_code} 200

${jsondata} To Json ${resp.content}
${jsondata}= To Json ${resp.content}
Should be Equal ${jsondata['args']} ${params}

Get HTTPS & Verify Cert
[Tags] get
Create Session httpbin https://httpbin.org verify=True

${resp} Get httpbin /get
${resp}= Get httpbin /get
Should Be Equal As Strings ${resp.status_code} 200


Get With Auth
[Tags] get
${auth} Create List user passwd
${auth}= Create List user passwd
Create Session httpbin https://httpbin.org auth=${auth}

${resp} Get httpbin /basic-auth/user/passwd
${resp}= Get httpbin /basic-auth/user/passwd
Should Be Equal As Strings ${resp.status_code} 200
${jsondata}= To Json ${resp.content}
Should Be Equal As Strings ${jsondata['authenticated']} True
Expand All @@ -52,22 +52,22 @@ Get With Auth
Post Request With No Data
[Tags] post
Create Session httpbin http://httpbin.org
${resp} Post httpbin /post
${resp}= Post httpbin /post
Should Be Equal As Strings ${resp.status_code} 200


Put Request With No Data
[Tags] put
Create Session httpbin http://httpbin.org
${resp} Put httpbin /put
${resp}= Put httpbin /put
Should Be Equal As Strings ${resp.status_code} 200


Post Request With No Dictionary
[Tags] post
Create Session httpbin http://httpbin.org
Set Test Variable ${data} some content
${resp} Post httpbin /post data=${data}
${resp}= Post httpbin /post data=${data}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${data}

Expand All @@ -76,18 +76,17 @@ Put Request With No Dictionary
[Tags] put
Create Session httpbin http://httpbin.org
Set Test Variable ${data} some content
${resp} Put httpbin /put data=${data}
${resp}= Put httpbin /put data=${data}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${data}


Post Requests
[Tags] post
Create Session httpbin http://httpbin.org

${data} Create Dictionary name bulkan surname evcimen
${headers} Create Dictionary Content-Type application/x-www-form-urlencoded
${resp} Post httpbin /post data=${data} headers=${headers}
${data}= Create Dictionary name bulkan surname evcimen
${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
${resp}= Post httpbin /post data=${data} headers=${headers}
${jsondata}= To Json ${resp.content}
Dictionary Should Contain Value ${jsondata['form']} bulkan
Dictionary Should Contain Value ${jsondata['form']} evcimen
Expand All @@ -96,9 +95,9 @@ Post Requests
Post With Unicode Data
[Tags] post
Create Session httpbin http://httpbin.org
${data} Create Dictionary name 度假村
${headers} Create Dictionary Content-Type application/x-www-form-urlencoded
${resp} Post httpbin /post data=${data} headers=${headers}
${data}= Create Dictionary name 度假村
${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
${resp}= Post httpbin /post data=${data} headers=${headers}
${jsondata}= To Json ${resp.content}
Dictionary Should Contain Value ${jsondata['form']} 度假村

Expand All @@ -107,46 +106,45 @@ Post Request With File
[Tags] post
Create Session httpbin http://httpbin.org

${file_data} Get Binary File ${CURDIR}${/}data.json
${files} Create Dictionary file ${file_data}
${resp} Post httpbin /post files=${files}
${file_data}= Get Binary File ${CURDIR}${/}data.json
${files}= Create Dictionary file ${file_data}
${resp}= Post httpbin /post files=${files}

${jsondata}= To Json ${resp.content}
${file} To Json ${jsondata['files']['file']}
${file}= To Json ${jsondata['files']['file']}
Dictionary Should Contain Key ${file} one
Dictionary Should Contain Key ${file} two


Put Requests
[Tags] put
Create Session httpbin http://httpbin.org

${data} Create Dictionary name bulkan surname evcimen
${headers} Create Dictionary Content-Type application/x-www-form-urlencoded
${resp} Put httpbin /put data=${data} headers=${headers}
${data}= Create Dictionary name bulkan surname evcimen
${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
${resp}= Put httpbin /put data=${data} headers=${headers}
${jsondata}= To Json ${resp.content}
Dictionary Should Contain Value ${jsondata['form']} bulkan
Dictionary Should Contain Value ${jsondata['form']} evcimen


Head Request
Create Session httpbin http://httpbin.org
${resp} Head httpbin /headers
${resp}= Head httpbin /headers
Should Be Equal As Strings ${resp.status_code} 200


Delete Request With No Data
[Tags] delete
Create Session httpbin http://httpbin.org
${resp} Delete httpbin /delete
${resp}= Delete httpbin /delete
Should Be Equal As Strings ${resp.status_code} 200


Delete Request With Data
[Tags] delete
Create Session httpbin http://httpbin.org
${data} Create Dictionary name bulkan surname evcimen
${resp} Delete httpbin /delete data=${data}
${data}= Create Dictionary name bulkan surname evcimen
${resp}= Delete httpbin /delete data=${data}
Should Be Equal As Strings ${resp.status_code} 200
Log ${resp.content}
${jsondata}= To Json ${resp.content}
Expand Down

0 comments on commit 6a2c8a1

Please sign in to comment.