Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 026f615

Browse files
committed
Fixup the DesignDocumentTests::test_get_info and CloudantIndexExceptionTests::test_index_usage_via_query tests for couch3
1 parent fec158e commit 026f615

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/unit/design_document_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2015, 2018 IBM Corp. All rights reserved.
2+
# Copyright (C) 2015, 2020 IBM Corp. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -776,7 +776,8 @@ def test_get_info(self):
776776
info = ddoc_remote.info()
777777
# Remove variable fields to make equality easier to check
778778
info['view_index'].pop('signature')
779-
info['view_index'].pop('disk_size')
779+
if 'disk_size' in info['view_index']:
780+
info['view_index'].pop('disk_size')
780781
# Remove Cloudant/Couch 2 fields if present to allow test to pass on Couch 1.6
781782
if 'sizes' in info['view_index']:
782783
info['view_index'].pop('sizes')

tests/unit/index_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2015, 2018 IBM Corp. All rights reserved.
2+
# Copyright (C) 2015, 2020 IBM Corp. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -390,7 +390,7 @@ def test_index_usage_via_query(self):
390390
self.populate_db_with_documents(100)
391391
result = self.db.get_query_result(fields=['name', 'age'],
392392
selector={'age': {'$eq': 6}}, raw_result=True)
393-
self.assertTrue(str(result['warning']).startswith("no matching index found"))
393+
self.assertTrue(str(result['warning']).lower().startswith("no matching index found"))
394394

395395
@attr(db='cloudant')
396396
class TextIndexTests(UnitTestDbBase):

0 commit comments

Comments
 (0)