Skip to content

Instantly share code, notes, and snippets.

@kivilahtio
Created February 7, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kivilahtio/7d536d26d4c31c5ea623076f22b03310 to your computer and use it in GitHub Desktop.
Save kivilahtio/7d536d26d4c31c5ea623076f22b03310 to your computer and use it in GitHub Desktop.
https://github.com/KohaSuomi/Patron-Store/blob/master/swagger/v1/swagger.yaml#L135
https://github.com/KohaSuomi/Patron-Store/blob/master/lib/PatronStore.pm#L54
https://github.com/KohaSuomi/Patron-Store/blob/master/lib/PatronStore/Controller/Api/V1/Authenticate.pm#L64
When running this test case:
https://github.com/KohaSuomi/Patron-Store/blob/master/t/auth.t
I get this result:
kivilahtio@ylilyonti:~/work/Patron-Store$ perl -Ilib t/auth.t
[OpenAPI] Add route get /api/v1/auth
[OpenAPI] Add route post /api/v1/auth
[OpenAPI] Add route post /api/v1/ssns
[OpenAPI] Add route get /api/v1/ssns
[OpenAPI] Add route get /api/v1/logs
[OpenAPI] Add route get /api/v1/ping
[OpenAPI] Add route get /api/v1/users
[OpenAPI] Add route post /api/v1/users
[OpenAPI] Add route get /api/v1/users/
[OpenAPI] Add route delete /api/v1/users/
[OpenAPI] Add route put /api/v1/users/
[OpenAPI] Add route get /api/v1/organizations
[OpenAPI] Add route post /api/v1/organizations
[OpenAPI] Add route get /api/v1/ssns/
[OpenAPI] Add route delete /api/v1/ssns/
[OpenAPI] Add route delete /api/v1/organizations/
[OpenAPI] Add route get /api/v1/organizations/
# Subtest: Api V1 auth happy path
[[waits for ~10 seconds here ...]]
# Premature connection close
not ok 1 - POST /api/v1/auth
# Failed test 'POST /api/v1/auth'
# at t/auth.t line 17.
not ok 2 - 204 No Content
# Failed test '204 No Content'
# at t/auth.t line 17.
# got: undef
# expected: '204'
not ok 3 - Unauthorized inventory_hostname mentioned
# Failed test 'Unauthorized inventory_hostname mentioned'
# at t/auth.t line 17.
# ''
# doesn't match '(?^ui:koha_production)'
not ok 4 - Description of the error received
# Failed test 'Description of the error received'
# at t/auth.t line 17.
# ''
# doesn't match '(?^ui:not in the allowed inventory)'
Mojo::Message::Response=HASH(0x59167d0)
[[waits for ~10 more seconds here ...]]
# Premature connection close
not ok 5 - GET /api/v1/auth
# Failed test 'GET /api/v1/auth'
# at t/auth.t line 25.
not ok 6 - 204 No Content
# Failed test '204 No Content'
# at t/auth.t line 25.
# got: undef
# expected: '204'
not ok 7 - Unauthorized inventory_hostname mentioned
# Failed test 'Unauthorized inventory_hostname mentioned'
# at t/auth.t line 25.
# ''
# doesn't match '(?^ui:koha_production)'
Mojo::Message::Response=HASH(0x59b3450) 1..7
# Looks like you failed 7 tests of 7.
not ok 1 - Api V1 auth happy path
# Failed test 'Api V1 auth happy path'
# at t/auth.t line 30.
1..1
# Looks like you failed 1 test of 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment