Skip to content

Commit c4e046f

Browse files
committed
PR fixes
1 parent 0873952 commit c4e046f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
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: 2 additions & 2 deletions
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
@@ -30,10 +31,9 @@ class TestReadmeExamples(unittest.TestCase):
3031
def setUpClass(cls):
3132
"""Set up test environment before all tests"""
3233
# Get WireMock URL from environment
33-
wiremock_url = os.environ.get('WIREMOCK_URL')
34+
wiremock_url = os.environ.get('WIREMOCK_URL', "http://localhost:8080")
3435

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

3939
# Set authentication environment variables

0 commit comments

Comments
 (0)