Skip to content

Commit

Permalink
create suite for basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ombre42 committed Oct 5, 2014
1 parent 84c6121 commit 784c0bf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
4 changes: 4 additions & 0 deletions test/acceptance/__init__.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*** Settings ***
Suite Setup Start Services
Suite Teardown Stop Services
Resource resource.txt
18 changes: 18 additions & 0 deletions test/acceptance/basicauth.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*** Settings ***
Resource resource.txt

*** Test Cases ***
Http Authentication
Create Soap Client ${TEST WSDL URL}
Set Location ${SECURE TEST URL}
Run Keyword And Expect Error (401, u'Authentication Required') Call Soap Method theAnswer
Set Http Authentication bob bob STANDARD
${answer} Call Soap Method theAnswer
Should Be Equal ${answer} ${42}
Create Soap Client ${TEST WSDL URL}
Set Http Authentication bob foo ALWAYS_send
${sum} Call Soap Method theAnswer
${request} Get Sent Request
# auth not needed, but should have been sent anyways
Should Be Equal As Strings ${request.headers['Authorization']} Basic Ym9iOmZvbw==
Run Keyword And Expect Error ValueError: 'bad' is not a supported type. Set Http Authentication bob foo bad
17 changes: 0 additions & 17 deletions test/acceptance/core.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
*** Settings ***
Suite Setup Start Services
Suite Teardown Stop Services
Resource resource.txt

*** Variables ***
Expand Down Expand Up @@ -200,21 +198,6 @@ Return ComplexType and Alter
${first name} Get Wsdl Object Attribute ${person} first-name
Should Be Equal As Strings ${first name} Bob

Http Authentication
Create Soap Client ${TEST WSDL URL}
Set Location ${SECURE TEST URL}
Run Keyword And Expect Error (401, u'Authentication Required') Call Soap Method theAnswer
Set Http Authentication bob bob STANDARD
${answer} Call Soap Method theAnswer
Should Be Equal ${answer} ${42}
Create Soap Client ${TEST WSDL URL}
Set Http Authentication bob foo ALWAYS_send
${sum} Call Soap Method theAnswer
${request} Get Sent Request
# auth not needed, but should have been sent anyways
Should Be Equal As Strings ${request.headers['Authorization']} Basic Ym9iOmZvbw==
Run Keyword And Expect Error ValueError: 'bad' is not a supported type. Set Http Authentication bob foo bad

Set Location
Create Soap Client ${TEST WSDL URL}
Set Location http://localhost:8080/badpath
Expand Down
2 changes: 0 additions & 2 deletions test/acceptance/ws-security.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
*** Settings ***
Suite Setup Start Services
Suite Teardown Stop Services
Test Setup Create Soap Client ${TEST WSDL URL}
Resource resource.txt

Expand Down

0 comments on commit 784c0bf

Please sign in to comment.