Skip to content

Commit 5c73e2f

Browse files
committed
PR fixes
1 parent 0873952 commit 5c73e2f

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"orders" database created.
2-
You have created the document:
2+
You have created the document. Response body:
33
{
4-
"_id": "example",
5-
"name": "Bob Smith",
6-
"joined": "2019-01-24T10:42:59.000Z",
4+
"ok": true,
5+
"id": "example",
76
"rev": "1-1b403633540686aa32d013fda9041a5d"
87
}

test/examples/src/create_db_and_doc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
import json
18+
1719
from ibm_cloud_sdk_core import ApiException
1820
from ibmcloudant.cloudant_v1 import CloudantV1, Document
1921

@@ -65,7 +67,5 @@
6567
"""
6668
# =====================================================================
6769

68-
# Keeping track of the revision number of the document object
69-
# is necessary for further UPDATE/DELETE operations:
70-
example_document.rev = create_document_response["rev"]
71-
print(f'You have created the document:\n{example_document}')
70+
response_body = json.dumps(create_document_response, indent=2)
71+
print(f'You have created the document. Response body:\n{response_body}')

test/examples/src/test_readme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import subprocess
2020
import sys
2121
import os
22+
import requests
2223
from pathlib import Path
2324

2425
parent_dir = Path(__file__).resolve().parent.parent
@@ -33,7 +34,6 @@ def setUpClass(cls):
3334
wiremock_url = os.environ.get('WIREMOCK_URL')
3435

3536
# Reset WireMock scenarios
36-
import requests
3737
requests.post(f"{wiremock_url}/__admin/scenarios/reset")
3838

3939
# Set authentication environment variables

test/examples/src/update_doc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@
8181
"""
8282
# =================================================================
8383

84-
# Keeping track of the latest revision number of the document
85-
# object is necessary for further UPDATE/DELETE operations:
86-
document["_rev"] = update_document_response["rev"]
8784
print(f'You have updated the document:\n' +
8885
json.dumps(document, indent=2))
8986

0 commit comments

Comments
 (0)