Updated version 0.1 of Nikita - interface update
Petter Reinholdtsen
pere at hungry.com
Wed Feb 1 23:09:08 CET 2017
[Thomas Sødring]
> Hmmm, Sorry I made a mistake here. This:
>
> http://localhost:8092/noark5v4/
>
>
> is equvialent to:
>
>
> http://n5test.kxml.no/api/
>
>
> "api" is a contextpath, equivalent to my "noark5v4"
Right. Then I was alrady testing the correct URL.
> Now I'm wondering if everything is actually OK. Can you check the
> following steps?
This look better, but archive creation was broken. This is the output
from my test script:
success: able to log in
success: found base
success: correct content-type for base
success: found _links in json response
recursively discovering URLs from the root
success: MIME type application/vnd.noark5-v4+json;charset=UTF-8 should be application/vnd.noark5-v4+json for url .
success: MIME type application/vnd.noark5-v4+json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/
failure: unable to fetch http://localhost:8092/noark5v4/hateoas-api/sakarkiv/
failure: unable to fetch http://localhost:8092/noark5v4/gui/
failure: unable to fetch http://localhost:8092/noark5v4/import-api/
failure: unable to fetch http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/
failure: unable to fetch http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkivskaper/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/klassifikasjon/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/mappe/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/basisregistrering/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/registrering/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/dokumentobjekt/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/klasse/
failure: MIME type application/json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/dokumentbeskrivelse/
failure: unable to fetch http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkiv
success: found .
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/basisregistrering/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/dokumentbeskrivelse/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/dokumentobjekt/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/klasse/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/klassifikasjon/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/mappe/
success: found http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/registrering/
15 successes, 13 failures
Traceback (most recent call last):
File "./runtest", line 223, in <module>
main()
File "./runtest", line 220, in main
t.runtests()
File "./runtest", line 211, in runtests
self.testNewDocument()
File "./runtest", line 135, in testNewDocument
(c, res) = self.json_post(createfondsurl, fondsdata)
File "./runtest", line 45, in json_post
response = self._browser.open(request)
File "/usr/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 203, in open
return self._mech_open(url, data, timeout=timeout)
File "/usr/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 255, in _mech_open
raise response
mechanize._response.httperror_seek_wrapper: HTTP Error 500: Internal Server Error
At the end here it is running this code:
fondsdata = {
"title" : "Title of the test fonds",
"description" : "Description of the test fonds",
"oppbevaringsted" : [ "location 1", "location2", "location3" ],
"documentMedium" : "Elektronisk arkiv",
}
createfondsurl = 'hateoas-api/arkivstruktur/ny-arkiv'
(c, res) = self.json_post(createfondsurl, fondsdata)
fondinfo = json.loads(c)
fondid = fondinfo['systemID']
self.verify(fondid is not None, "created fond")
and this fail in the HTTP request (aka json_post).
> curl -v --header "Accept:application/vnd.noark5-v4+json" -X GET
> http://localhost:8092/noark5v4/
>
> is giving me:
Me too.
> curl -v --header "Accept:application/vnd.noark5-v4+json" -X GET -b
> cookie.txt http://localhost:8092/noarkv4/hateoas-api/arkivstruktur/
>
> is giving me
I assume the noarkv4 URL is a typo for
<URL: http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ >, and I
get the same result you get.
> curl -v --header "Accept:application/vnd.noark5-v4+json" -X GET -b
> cookie.txt http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/
>
> is giving me:
I get a 500 server error. :(
--
Happy hacking
Petter Reinholdtsen
More information about the nikita-noark
mailing list