Skip to content

Commit c796126

Browse files
fixing tests
1 parent fec5556 commit c796126

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

.env.enc

432 Bytes
Binary file not shown.

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@ python:
1111
- '3.5'
1212
- 3.5-dev
1313
before_install:
14-
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_c3e85137836d_key
15-
-iv $encrypted_c3e85137836d_iv -in .env.enc -out .env -d || true'
14+
- ! '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_6e98b3e8e789_key -iv $encrypted_6e98b3e8e789_iv -in .env.enc -out .env -d || true'
1615
install:
1716
- pip install -r requirements-dev.txt
1817
- pip install pylint
1918
- pip install codecov
2019
- pip install git+git://github.com/watson-developer-cloud/python-sdk.git#egg=watson-developer-cloud
21-
2220
script:
23-
- sh pylint.sh
24-
- py.test test --cov=watson_developer_cloud
21+
- sh pylint.sh
22+
- py.test test --cov=watson_developer_cloud
2523
after_success:
26-
- codecov
27-
- docs/publish.sh
28-
24+
- codecov
25+
- docs/publish.sh

examples/retrieve_and_rank_v1.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# print(json.dumps(created_cluster, indent=2))
1616

1717
# Replace with your own solr_cluster_id
18-
solr_cluster_id = 'sc31a30e84_9094_4af2_93af_a8751257d4cc'
18+
solr_cluster_id = 'scd4766c4a_c102_48bd_acfe_7c929afa5ca4'
1919

2020
status = retrieve_and_rank.get_solr_cluster_status(solr_cluster_id=solr_cluster_id)
2121
print(json.dumps(status, indent=2))
@@ -34,12 +34,13 @@
3434
# collection = retrieve_and_rank.create_collection(solr_cluster_id, 'test-collection', 'test-config')
3535
# print(json.dumps(collection, indent=2))
3636

37-
collections = retrieve_and_rank.list_collections(solr_cluster_id=solr_cluster_id)
38-
print(json.dumps(collections, indent=2))
37+
if (len(configs['solr_configs']) > 0):
38+
collections = retrieve_and_rank.list_collections(solr_cluster_id=solr_cluster_id)
39+
print(json.dumps(collections, indent=2))
3940

40-
pysolr_client = retrieve_and_rank.get_pysolr_client(solr_cluster_id, 'test-collection')
41-
results = pysolr_client.search('bananas')
42-
print(results.docs)
41+
pysolr_client = retrieve_and_rank.get_pysolr_client(solr_cluster_id, 'test-collection')
42+
results = pysolr_client.search('bananas')
43+
print(results)
4344

4445
# Rankers
4546

test/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# tests to exclude
1313
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py',
14-
'alchemy_language_v1.py', 'alchemy_vision_v1.py', 'relationship_extraction_v1_beta.py']
14+
'alchemy_language_v1.py', 'alchemy_vision_v1.py']
1515

1616
# examples path. /examples
1717
examples_path = join(dirname(__file__), '../', 'examples', '*.py')

0 commit comments

Comments
 (0)