Skip to content

Commit

Permalink
Updated url in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Jul 21, 2016
1 parent 2e9209f commit aa047f0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class DumpsTestAppwebtest(TestApp):
def do_request(self, req, status=None, expect_errors=None):
req.headers.environ["HTTP_HOST"] = "docs.api-sandbox.openprocurement.org"
req.headers.environ["HTTP_HOST"] = "docs-sandbox.openprocurement.org"
if hasattr(self, 'file_obj') and not self.file_obj.closed:
self.file_obj.write(req.as_bytes(True))
self.file_obj.write("\n\n")
Expand Down Expand Up @@ -58,13 +58,13 @@ def test_docs(self):
response = self.app.post('/register', {'hash': md5hash, 'filename': 'file.txt'})
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')
self.assertIn('http://docs.api-sandbox.openprocurement.org/upload/', response.json['upload_url'])
self.assertIn('http://docs-sandbox.openprocurement.org/upload/', response.json['upload_url'])

with open('docs/source/tutorial/upload.http', 'w') as self.app.file_obj:
response = self.app.post(response.json['upload_url'], upload_files=[('file', u'file.txt', 'content')])
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertIn('http://docs.api-sandbox.openprocurement.org/get/', response.json['get_url'])
self.assertIn('http://docs-sandbox.openprocurement.org/get/', response.json['get_url'])

with open('docs/source/tutorial/get.http', 'w') as self.app.file_obj:
response = self.app.get(response.json['get_url'])
Expand All @@ -76,4 +76,4 @@ def test_docs(self):
response = self.app.post('/upload', upload_files=[('file', u'file.txt', 'content')])
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertIn('http://docs.api-sandbox.openprocurement.org/get/', response.json['get_url'])
self.assertIn('http://docs-sandbox.openprocurement.org/get/', response.json['get_url'])
4 changes: 2 additions & 2 deletions docs/source/tutorial/get.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GET /get/9be740448a464fcd831185dafb82b70a?Expires=1467737469&KeyID=21e1b21e&Signature=EIQTMEZfOLsoHsnz0OxI3gr7nwmuAokm7p%2FW5sPwv%252BqXhc%252BV8c2%2FFBSAq2ux3ZK3dobboYI4r3gqJ0aaz0ebDQ%253D%253D HTTP/1.0
GET /get/6c4503d85a614f78b1ef9cd104882e28?Expires=1469095533&KeyID=37afbb51&Signature=2HhuTEuqX2ssvMN0Um5m6J22kacJG4h5nueo8OCO%2FjmqPI29tMooAd1BJMDiINJ0XIFDNLkCDQA8N3MfWsU8Cw%253D%253D HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Host: docs.api-sandbox.openprocurement.org
Host: docs-sandbox.openprocurement.org


200 OK
Expand Down
8 changes: 4 additions & 4 deletions docs/source/tutorial/register.http
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ POST /register HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 55
Content-Type: application/x-www-form-urlencoded
Host: docs.api-sandbox.openprocurement.org
Host: docs-sandbox.openprocurement.org

hash=9a0364b9e99bb480dd25e1f0284c8555&filename=file.txt


201 Created
Content-Type: application/json; charset=UTF-8
Location: http://docs.api-sandbox.openprocurement.org/upload/9be740448a464fcd831185dafb82b70a?KeyID=21e1b21e&Signature=Sx9PlkGNfRl839V7OTTpvspJSv99Ft%2FcOKdXXSYvy6z1HIux9m%252BrDkAArIh3FUJsbB5bW8HwFUxNiNhi43lHBQ%253D%253D
Location: http://docs-sandbox.openprocurement.org/upload/6c4503d85a614f78b1ef9cd104882e28?KeyID=37afbb51&Signature=mQyAjy41T1giTfCj2wkDmTVUlRHAzI3FrfGd5DvsmFvDCAqeQPIPP81F5jraZSffxVsGGZvCx6W1A6fVGgHQCw%253D%253D

{
"upload_url": "http://docs.api-sandbox.openprocurement.org/upload/9be740448a464fcd831185dafb82b70a?KeyID=21e1b21e&Signature=Sx9PlkGNfRl839V7OTTpvspJSv99Ft%2FcOKdXXSYvy6z1HIux9m%252BrDkAArIh3FUJsbB5bW8HwFUxNiNhi43lHBQ%253D%253D",
"upload_url": "http://docs-sandbox.openprocurement.org/upload/6c4503d85a614f78b1ef9cd104882e28?KeyID=37afbb51&Signature=mQyAjy41T1giTfCj2wkDmTVUlRHAzI3FrfGd5DvsmFvDCAqeQPIPP81F5jraZSffxVsGGZvCx6W1A6fVGgHQCw%253D%253D",
"data": {
"url": "http://docs.api-sandbox.openprocurement.org/get/9be740448a464fcd831185dafb82b70a?KeyID=21e1b21e&Signature=2UyCtqlO51VlL%2FGjbymA0n%252BaMY8TUDXwMqPVHE4t9yaoctqtrOWOoKOym9q28GLJHoTg1JNWdTgBoeJBHL38AQ%253D%253D",
"url": "http://docs-sandbox.openprocurement.org/get/6c4503d85a614f78b1ef9cd104882e28?KeyID=37afbb51&Signature=iI3lDDleJxVGWQz9fK0KWsFGwqnFxYSW4zhP0kO5uQz1%252BnoJn0mHa0F9hbJw1FRqaoDg8wseD1V0JIdR225bDQ%253D%253D",
"hash": "9a0364b9e99bb480dd25e1f0284c8555"
}
}
Expand Down
14 changes: 7 additions & 7 deletions docs/source/tutorial/upload-file.http
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
POST /upload HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 179
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy339650440173$
Host: docs.api-sandbox.openprocurement.org
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy363349153179$
Host: docs-sandbox.openprocurement.org

------------a_BoUnDaRy339650440173$
------------a_BoUnDaRy363349153179$
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain

content
------------a_BoUnDaRy339650440173$--
------------a_BoUnDaRy363349153179$--



200 OK
Content-Type: application/json; charset=UTF-8
Location: http://docs.api-sandbox.openprocurement.org/get/1a4ccd22ac4d4d288e27e6ed37f9c322?Expires=1467737469&KeyID=21e1b21e&Signature=QcFwJWPxaa%252Bvp5MyNiMLn10T0GnsepVdkkD9W84UXr3govyJ2sU1oFVmf1vptx2DUAwdWi56VfOqyFWJbtKzAw%253D%253D
Location: http://docs-sandbox.openprocurement.org/get/5e2b0a861ac7444dbcde7c4b3db65fc8?Expires=1469095533&KeyID=37afbb51&Signature=tKNf%252BcpLDu1qPGtLWlvb4f%252BX7o%2FhQbf1CQk%2FVk14CEmikn2N10OOnYshInPT7PXdUwNv3NP%2F9jQSCWo3wXsjAA%253D%253D

{
"get_url": "http://docs.api-sandbox.openprocurement.org/get/1a4ccd22ac4d4d288e27e6ed37f9c322?Expires=1467737469&KeyID=21e1b21e&Signature=QcFwJWPxaa%252Bvp5MyNiMLn10T0GnsepVdkkD9W84UXr3govyJ2sU1oFVmf1vptx2DUAwdWi56VfOqyFWJbtKzAw%253D%253D",
"get_url": "http://docs-sandbox.openprocurement.org/get/5e2b0a861ac7444dbcde7c4b3db65fc8?Expires=1469095533&KeyID=37afbb51&Signature=tKNf%252BcpLDu1qPGtLWlvb4f%252BX7o%2FhQbf1CQk%2FVk14CEmikn2N10OOnYshInPT7PXdUwNv3NP%2F9jQSCWo3wXsjAA%253D%253D",
"data": {
"url": "http://docs.api-sandbox.openprocurement.org/get/1a4ccd22ac4d4d288e27e6ed37f9c322?KeyID=21e1b21e&Signature=RbT3RyJSRLt9FCjv2w%252BtoJT1bWJC9af84eR773RCBI8UsDpir6MZGS4ps7ik5icoUlf%2FfpmJkDZWlg72%252Bp66Dw%253D%253D",
"url": "http://docs-sandbox.openprocurement.org/get/5e2b0a861ac7444dbcde7c4b3db65fc8?KeyID=37afbb51&Signature=mAJf1vDy5TyxTQLWhqsD3tWWYJqtyu7TU5vgEx4XWGOzxjVeMYTtc3bqWw5pHBts4VKInLOF5Aehj%2FVo3XxgCA%253D%253D",
"format": "text/plain",
"hash": "9a0364b9e99bb480dd25e1f0284c8555",
"title": "file.txt"
Expand Down
14 changes: 7 additions & 7 deletions docs/source/tutorial/upload.http
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
POST /upload/9be740448a464fcd831185dafb82b70a?KeyID=21e1b21e&Signature=Sx9PlkGNfRl839V7OTTpvspJSv99Ft%2FcOKdXXSYvy6z1HIux9m%252BrDkAArIh3FUJsbB5bW8HwFUxNiNhi43lHBQ%253D%253D HTTP/1.0
POST /upload/6c4503d85a614f78b1ef9cd104882e28?KeyID=37afbb51&Signature=mQyAjy41T1giTfCj2wkDmTVUlRHAzI3FrfGd5DvsmFvDCAqeQPIPP81F5jraZSffxVsGGZvCx6W1A6fVGgHQCw%253D%253D HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 179
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy460497694743$
Host: docs.api-sandbox.openprocurement.org
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy679797881491$
Host: docs-sandbox.openprocurement.org

------------a_BoUnDaRy460497694743$
------------a_BoUnDaRy679797881491$
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain

content
------------a_BoUnDaRy460497694743$--
------------a_BoUnDaRy679797881491$--



200 OK
Content-Type: application/json; charset=UTF-8

{
"get_url": "http://docs.api-sandbox.openprocurement.org/get/9be740448a464fcd831185dafb82b70a?Expires=1467737469&KeyID=21e1b21e&Signature=EIQTMEZfOLsoHsnz0OxI3gr7nwmuAokm7p%2FW5sPwv%252BqXhc%252BV8c2%2FFBSAq2ux3ZK3dobboYI4r3gqJ0aaz0ebDQ%253D%253D",
"get_url": "http://docs-sandbox.openprocurement.org/get/6c4503d85a614f78b1ef9cd104882e28?Expires=1469095533&KeyID=37afbb51&Signature=2HhuTEuqX2ssvMN0Um5m6J22kacJG4h5nueo8OCO%2FjmqPI29tMooAd1BJMDiINJ0XIFDNLkCDQA8N3MfWsU8Cw%253D%253D",
"data": {
"url": "http://docs.api-sandbox.openprocurement.org/get/9be740448a464fcd831185dafb82b70a?KeyID=21e1b21e&Signature=2UyCtqlO51VlL%2FGjbymA0n%252BaMY8TUDXwMqPVHE4t9yaoctqtrOWOoKOym9q28GLJHoTg1JNWdTgBoeJBHL38AQ%253D%253D",
"url": "http://docs-sandbox.openprocurement.org/get/6c4503d85a614f78b1ef9cd104882e28?KeyID=37afbb51&Signature=iI3lDDleJxVGWQz9fK0KWsFGwqnFxYSW4zhP0kO5uQz1%252BnoJn0mHa0F9hbJw1FRqaoDg8wseD1V0JIdR225bDQ%253D%253D",
"format": "text/plain",
"hash": "9a0364b9e99bb480dd25e1f0284c8555",
"title": "file.txt"
Expand Down

0 comments on commit aa047f0

Please sign in to comment.