Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
eb1daad
cpc phase2 changes
sridevi-15 Aug 27, 2021
41610db
new changes for persistent config
sridevi-15 Sep 24, 2021
316b8af
fixed sgw upgrade conftest
sridevi-15 Sep 24, 2021
ff6a89e
fix the unpack
sridevi-15 Sep 25, 2021
7ed6676
fix the unpack
sridevi-15 Sep 27, 2021
b96e8a8
merged changes from master
sridevi-15 Sep 28, 2021
47d3169
fix unpacking
sridevi-15 Sep 28, 2021
45770ea
temporary db config
sridevi-15 Sep 30, 2021
dcf208c
few changes
sridevi-15 Oct 1, 2021
4037ed0
put db config
sridevi-15 Oct 1, 2021
f328b92
put db config
sridevi-15 Oct 1, 2021
084464a
put db config
sridevi-15 Oct 1, 2021
0844b30
put db config
sridevi-15 Oct 1, 2021
b02651c
put db config
sridevi-15 Oct 4, 2021
f09ab05
revert back sgw_seperate utils method name
sridevi-15 Oct 4, 2021
a9ec8f5
fixes again
sridevi-15 Oct 4, 2021
cb75753
sync function changes
sridevi-15 Oct 5, 2021
6b1e00a
sync function logic fix
sridevi-15 Oct 5, 2021
7b9d6b5
fixed missing params
sridevi-15 Oct 6, 2021
3fc162f
fixed db offline and users and roles for persistent config
sridevi-15 Oct 21, 2021
c2f6e19
fixed sanity tests
sridevi-15 Oct 25, 2021
8e7155f
fixed webhook tests
sridevi-15 Oct 26, 2021
e8609de
updated regression tests with persistent config
sridevi-15 Oct 29, 2021
e88a3c3
fixed multiple dbs and invalid js tests
sridevi-15 Nov 3, 2021
47837ca
more debugging for topology
sridevi-15 Nov 4, 2021
339bfae
updated regression tests for persistent config
sridevi-15 Nov 8, 2021
cc7cc86
fixed log tests too
sridevi-15 Nov 10, 2021
626897a
topology fixing-1
sridevi-15 Nov 10, 2021
617b18c
log fixes-2
sridevi-15 Nov 10, 2021
676c270
more debugging for topology
sridevi-15 Nov 11, 2021
6631ae5
fixed all log tests
sridevi-15 Nov 12, 2021
60c06a4
temp topology skip
sridevi-15 Nov 12, 2021
cf9821b
fixed few more log tests
sridevi-15 Nov 13, 2021
d4ef843
pulled changes from master and merge to this branch
sridevi-15 Nov 15, 2021
2cf2694
fixed undefined variable
sridevi-15 Nov 16, 2021
c2c6bdb
fixed channel access revocation tests
sridevi-15 Nov 16, 2021
e923fd6
fixed channel access revocation tests2
sridevi-15 Nov 17, 2021
438f196
fixed channel access revocation tests3
sridevi-15 Nov 17, 2021
c03e0a8
added sleep time after starting replication
sridevi-15 Nov 17, 2021
661d7c8
fix the topology tests
sridevi-15 Nov 19, 2021
d419198
added support for sg-ssl
sridevi-15 Nov 24, 2021
9f70ef1
added support for sg-ssl
sridevi-15 Nov 29, 2021
c30683a
updated cbl tests
sridevi-15 Dec 5, 2021
237b595
fixed with update db
sridevi-15 Dec 7, 2021
56e6afd
updated sgw cluster config for multiple sgws
sridevi-15 Dec 8, 2021
25307a4
fixed compilation error
sridevi-15 Dec 8, 2021
4f0a656
having default group
sridevi-15 Dec 8, 2021
e350fc6
fix the macos condition
sridevi-15 Dec 8, 2021
3672480
moved back stop windows file to tasks directory
sridevi-15 Dec 8, 2021
d10fce1
temp fix
sridevi-15 Dec 10, 2021
70402fc
fix expire attachments
sridevi-15 Dec 16, 2021
dd6619c
fixed some sgw tests to work persistent config
sridevi-15 Dec 24, 2021
670e665
fixed the tests
sridevi-15 Jan 19, 2022
7ffc5ce
fixed persistent config variable on conftest
sridevi-15 Jan 19, 2022
1f57782
err check False added
sridevi-15 Jan 19, 2022
f63321a
increase the timeout
sridevi-15 Jan 20, 2022
8235999
increase the timeout2
sridevi-15 Jan 20, 2022
46c2828
fixed upgrade
sridevi-15 Jan 20, 2022
ac10d72
removed assertions for replications
sridevi-15 Jan 20, 2022
d82517e
fixed upgrade utils
sridevi-15 Jan 25, 2022
eeffac1
added support for coubhase without port
sridevi-15 Jan 26, 2022
15563b4
added group ids to the test
sridevi-15 Jan 27, 2022
ff871f3
fix upgrade sgreplicat2
sridevi-15 Jan 27, 2022
a852be8
fixed all prometheus config
sridevi-15 Jan 28, 2022
3939d8b
fixed tests
sridevi-15 Jan 31, 2022
076450a
fixed metrics interface config
sridevi-15 Jan 31, 2022
1e61cb1
upgrade test added retries
sridevi-15 Jan 31, 2022
b1e2644
sgreplicate test time
sridevi-15 Jan 31, 2022
df1e7df
add debug stmts
sridevi-15 Feb 1, 2022
6288f50
Fixes to some persistent config tests and other failing tests on this…
Feb 14, 2022
1328f48
Added extra invalid config file as extra test case
hthomps-cb Feb 14, 2022
d08ad8b
Merge branch 'feature/centralized_persistent_config_phase5' of https:…
hthomps-cb Feb 14, 2022
93e5a11
Undo unintended change
hthomps-cb Feb 14, 2022
b664e90
fixed the changes
sridevi-15 Feb 16, 2022
dd671e3
fixed the test
sridevi-15 Feb 24, 2022
97a69a7
clean up all the files
sridevi-15 Mar 13, 2022
ca7bb9e
got the change from master for prometheus fix
sridevi-15 Mar 18, 2022
d78d684
fixed some tests
sridevi-15 Mar 23, 2022
5b96369
fixed the flags and deploy flag
sridevi-15 Mar 24, 2022
bcfd8ad
fixed upgrade util methods
sridevi-15 Mar 24, 2022
d292a46
more debugging
sridevi-15 Mar 27, 2022
69420d0
more debugging
sridevi-15 Mar 27, 2022
92e0471
more debugging
sridevi-15 Mar 27, 2022
9b09abb
more debugging
sridevi-15 Mar 27, 2022
f8c5a80
more debugging
sridevi-15 Mar 27, 2022
01ff06d
added debugging
sridevi-15 Mar 28, 2022
fa081d7
got back to the right one
sridevi-15 Mar 28, 2022
228155d
removed duplicate and wrong code
sridevi-15 Mar 29, 2022
4e0097d
fix the retries checking of sync gateway docs read and write
sridevi-15 Mar 29, 2022
103e260
fix the retries checking of sync gateway docs read and write
sridevi-15 Mar 29, 2022
f7304ce
make changes to fix the timing with cbl and SGW
sridevi-15 Mar 29, 2022
88952c2
increase idle time
sridevi-15 Mar 29, 2022
b5473c8
additional debugging
sridevi-15 Mar 30, 2022
c19baa9
resolved conflicts of authenticated admin api and master
sridevi-15 Apr 2, 2022
9132cf4
fix an authentication issue of get_all_docs function
euniceatcouchbase Apr 4, 2022
0f6694b
fixed admin api in new utils of persistent config
sridevi-15 Apr 4, 2022
f7906b3
fixed the send_db_config_restcall with admin api
sridevi-15 Apr 5, 2022
f168125
fix a flake8 error
euniceatcouchbase Apr 5, 2022
0431e63
fix the cluster flag
sridevi-15 Apr 5, 2022
3084dd9
admin api fixes
sridevi-15 Apr 5, 2022
c393d0a
fix few more tests
sridevi-15 Apr 7, 2022
7381ea1
fix more tests
sridevi-15 Apr 7, 2022
6050831
fixed channel access revocation tests
sridevi-15 Apr 7, 2022
15f541d
fixed import
sridevi-15 Apr 7, 2022
726198e
fixed the sgreplicate2 admin util
sridevi-15 Apr 7, 2022
50d809b
fix for upgrade
sridevi-15 Apr 8, 2022
72480be
fixed persistent config changes
sridevi-15 Apr 11, 2022
b2885a9
fix again few tests to work with auth
sridevi-15 Apr 12, 2022
859ac9e
fix automatic migration upgrade
sridevi-15 Apr 13, 2022
9db0ac6
fix the tests
sridevi-15 Apr 14, 2022
5bf632f
fix the tests
sridevi-15 Apr 14, 2022
d560a39
fix the tests
sridevi-15 Apr 14, 2022
0fb7af4
fix the sgreplicat2 upgrade test
sridevi-15 Apr 15, 2022
0a8e1e9
fix the tests
sridevi-15 Apr 16, 2022
595e73a
fixed new tests
sridevi-15 Apr 16, 2022
ade2005
fixed new tests
sridevi-15 Apr 16, 2022
8e642f5
fixed new tests
sridevi-15 Apr 17, 2022
e94d9fd
fixed new tests
sridevi-15 Apr 18, 2022
0dcb392
fix the test
sridevi-15 Apr 18, 2022
dac2da7
fix the tests on changes tracker
sridevi-15 Apr 18, 2022
a6f4437
skip automatic migration condition fixed
sridevi-15 Apr 18, 2022
b8fb471
fixes sgreplicate2
sridevi-15 Apr 20, 2022
9d20956
fixed the tests
sridevi-15 Apr 22, 2022
3688017
fix upgrade test
sridevi-15 Apr 22, 2022
4a829f8
fix upgrade test
sridevi-15 Apr 23, 2022
8ef4628
debugging upgrade
sridevi-15 Apr 23, 2022
8fa2f87
sgupgrade sg replication fix'
sridevi-15 Apr 24, 2022
d5d1cdb
fix sgreplicat2 upgrade test
sridevi-15 Apr 25, 2022
b1dd0e6
fix the tests with enable persistent config and enable admin api
sridevi-15 Apr 26, 2022
0f12148
fixed the tests
sridevi-15 Apr 27, 2022
165a9fe
fix the tests
sridevi-15 Apr 28, 2022
4f50141
fix the tests
sridevi-15 May 3, 2022
7ea9c45
fixed prometheus failures with admin api changes
sridevi-15 May 6, 2022
2774324
Merge branch 'fix/cbl-upgrade-auth-issue' of https://github.com/couch…
sridevi-15 May 6, 2022
2dda8f0
fix all the tests
sridevi-15 May 6, 2022
c2068ee
clean up a bit
sridevi-15 May 9, 2022
310588b
replaced reserved property to a differrent property
sridevi-15 May 12, 2022
184e81f
replace reserver properties to a differrent property
sridevi-15 May 15, 2022
d8d1e5c
fixed upgrade test
sridevi-15 May 16, 2022
8cbb5f4
fix the SGW upgrade test
sridevi-15 May 17, 2022
54bbcb0
updated the upgrade test
sridevi-15 May 17, 2022
2f9bb36
debugging added for sgreplicate2 upgrade test
sridevi-15 May 17, 2022
410a69f
added more sleep time for sg upgrade
sridevi-15 May 18, 2022
7664383
added debugging
sridevi-15 May 18, 2022
2a174fa
Revert "replace reserver properties to a differrent property"
sridevi-15 May 27, 2022
29aeccc
reverted back the reserved property changes and added new test for 3.0.3
sridevi-15 Jun 1, 2022
a0d7cad
merged doc resurrection test
sridevi-15 Jun 1, 2022
44664c1
fixed reserver property fixes
sridevi-15 Jun 8, 2022
1c7f561
fixed admin api fixes
sridevi-15 Jun 9, 2022
894c6fe
fix few more functional tests
sridevi-15 Jun 10, 2022
f9875dc
fix/reserver_properties_fixes
sridevi-15 Jun 10, 2022
2b88dbd
fixed the tests
sridevi-15 Jun 10, 2022
9b56aa5
fixed more tests
sridevi-15 Jun 10, 2022
4ce3493
fixed more tests
sridevi-15 Jun 10, 2022
e83a360
fixed the tests
sridevi-15 Jun 11, 2022
42d1072
debugging msg
sridevi-15 Jun 13, 2022
687b1c1
debugging msg
sridevi-15 Jun 13, 2022
9bfb415
debugging msg
sridevi-15 Jun 13, 2022
4e7b342
debugging msg
sridevi-15 Jun 13, 2022
edf104a
fixed config
sridevi-15 Jun 13, 2022
21d3802
Merge branch 'feature/centralized_persistent_config_phase7' of github…
sridevi-15 Jun 14, 2022
381964e
Update requirements.txt
saigon Jul 19, 2022
fc4bbc3
Reverted unnecessary changes
hthomps-cb Aug 25, 2022
43a0f2f
Update TestServerAndroid.py
saigon Aug 31, 2022
8aa474b
Update requirements.txt
saigon Aug 31, 2022
c2e3590
Update cluster_config_utils.py
saigon Aug 31, 2022
35dbb95
Adjust the ud tags check to ignore binary files
gilkal Sep 1, 2022
61ef090
Merge pull request #1930 from couchbaselabs/update_ud_tags_checks
hthomps-cb Sep 1, 2022
5beb8d5
Merge pull request #1919 from couchbaselabs/fix/cbl-upgrade-auth-issue
hthomps-cb Sep 1, 2022
c15c478
Revert "Update requirements.txt"
hthomps-cb Sep 1, 2022
9b278e2
Merge pull request #1931 from couchbaselabs/fix/requirements
gilkal Sep 1, 2022
ec6ea2e
Update TestServerAndroid.py
saigon Sep 1, 2022
24b6ac5
Update troposphere to version 4.0.2
gilkal Sep 2, 2022
3c7a3ca
Merge pull request #1933 from couchbaselabs/update/troposhere4x
hthomps-cb Sep 2, 2022
7b678b6
Merge branch 'master' into feature/persistent_config_10
hthomps-cb Sep 2, 2022
f7cf783
Merge pull request #1925 from couchbaselabs/feature/persistent_config_10
hthomps-cb Sep 2, 2022
607c264
Update TestServerAndroid.py
saigon Sep 3, 2022
545c32b
Update conftest.py
saigon Sep 3, 2022
f464209
Update TestServerAndroid.py
saigon Sep 6, 2022
683bfd5
Update conftest.py
saigon Sep 6, 2022
7e9ca1b
Update conftest.py
saigon Sep 6, 2022
4b2c0b4
Add files via upload
saigon Sep 6, 2022
47217b6
Update test_basic_sc.py
saigon Sep 6, 2022
4f83523
Update test_basic_sc.py
saigon Sep 6, 2022
d3012cd
Fix flake8 failures
gilkal Sep 7, 2022
7f13212
Merge pull request #1935 from couchbaselabs/fix/flake8_failures
hthomps-cb Sep 7, 2022
597b383
Delete test_basic_sc.py
saigon Sep 7, 2022
cf97908
Add files via upload
saigon Sep 7, 2022
b25244e
Update conftest.py
saigon Sep 7, 2022
9ceec73
Add files via upload
saigon Sep 7, 2022
f549de4
Disable TLS and server verification when server ssl enabled
gilkal Sep 12, 2022
e061511
Set the TLS setting value to the right value (false)
gilkal Sep 12, 2022
6d9d62d
Update install_sync_gateway.py
saigon Sep 12, 2022
aab8f0a
Update block-http-ports.yml
saigon Sep 12, 2022
db6f52e
Update TestServerAndroid.py
saigon Sep 12, 2022
7ec54da
Update install_sync_gateway.py
saigon Sep 12, 2022
95209b3
Update SyncGateway.py
saigon Sep 12, 2022
25a270e
Update syncgateway.py
saigon Sep 12, 2022
677eabb
Update sgaccel.py
saigon Sep 12, 2022
fc324fe
Update cluster.py
saigon Sep 12, 2022
a20ae67
Update block-http-ports.yml
saigon Sep 12, 2022
e10b93e
Update cluster.py
saigon Sep 12, 2022
69ff0c5
Update sgaccel.py
saigon Sep 12, 2022
e5fe7a0
Update syncgateway.py
saigon Sep 12, 2022
bdd9276
Update SyncGateway.py
saigon Sep 12, 2022
7e9722f
Update install_sync_gateway.py
saigon Sep 12, 2022
859f620
Add files via upload
saigon Sep 12, 2022
a9ac4da
Add files via upload
saigon Sep 12, 2022
0484bf0
Update the couchbase client because of the Python SDK issue PYCBC-1226
gilkal Sep 13, 2022
ad090cd
update depenedencies to accomodate changes to slave and newer couchba…
gilkal Sep 14, 2022
3408bd7
Merge pull request #1939 from couchbaselabs/master-3.0
hthomps-cb Sep 14, 2022
2679ab5
Merge pull request #1938 from couchbaselabs/update/requirements.txt
gilkal Sep 14, 2022
c055f61
Fix typos
gilkal Sep 14, 2022
2dca587
Remove a redundant True
gilkal Sep 14, 2022
d184e41
Merge pull request #1937 from couchbaselabs/fix/server_witl_ssl
gilkal Sep 14, 2022
20492fe
Update test_cbl_upgrade.py
saigon Sep 15, 2022
a5d1da9
Update MobileRestClient.py
saigon Sep 15, 2022
d7dfb9d
Update test_cbl_upgrade.py
saigon Sep 16, 2022
63fba03
Update test_cbl_upgrade.py
saigon Sep 16, 2022
763e5ac
Update test_cbl_upgrade.py
saigon Sep 16, 2022
901d929
Update install_couchbase_server.py
saigon Sep 20, 2022
3048a44
Add files via upload
saigon Sep 20, 2022
421894f
Add files via upload
saigon Sep 20, 2022
195e565
Update clean_cluster.py
saigon Sep 20, 2022
5758df0
Update test_cbl_reserve_properties.py
abhayayay Sep 22, 2022
979cf45
Update test_cbl_reserve_properties.py
abhayayay Sep 22, 2022
cf9d7be
Merge branch 'master' into increase-sdk-timeout-4
saigon Sep 22, 2022
679e89a
Update test_database.py
saigon Sep 22, 2022
6409138
Fix/webhook (#1946)
gilkal Sep 23, 2022
26a6cd7
Fix/test non mobile ignore count (#1944)
gilkal Sep 23, 2022
c7771ef
Update test_replication.py
abhayayay Sep 28, 2022
d1f05ee
Update test_query.py
saigon Sep 28, 2022
d1f65d3
Feature/scopes and collections latest (#1941)
gilkal Sep 28, 2022
f32f61f
Update TestServerAndroid.py
saigon Sep 28, 2022
aaa45a5
Update MobileRestClient.py
saigon Sep 29, 2022
99d1d64
Update test_cbl_reserve_properties.py
saigon Sep 29, 2022
7689b7d
Update test_cbl_reserve_properties.py
saigon Sep 29, 2022
29c71bb
Enable developer preview for the custom port tests (#1947)
gilkal Sep 30, 2022
0c2fd97
scopes and collection cbl
abhayayay Oct 3, 2022
2df130a
Update TestServerAndroid.py
saigon Oct 3, 2022
db30f82
Update syncgateway.py
saigon Oct 3, 2022
15dec1f
Update test_cbl_reserve_properties.py (#1943)
abhayayay Oct 4, 2022
6f40637
scopes and collection cbl (#1948)
abhayayay Oct 4, 2022
70ce111
create bulk doc in scope
abhayayay Oct 6, 2022
37afaf2
create bulk doc in scope
abhayayay Oct 6, 2022
fcf1535
create bulk doc in scope
abhayayay Oct 6, 2022
e5a8e29
Merge branch 'master' into frameowrk_c_ios
abhayayay Oct 6, 2022
12c7365
Merge pull request #1950 from couchbaselabs/frameowrk_c_ios
abhayayay Oct 6, 2022
577edf1
Update Database.py
abhayayay Oct 6, 2022
58a2c93
Merge branch 'master' into increase-sdk-timeout-4
saigon Oct 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions CBLClient/Collection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
from CBLClient.Client import Client
from CBLClient.Args import Args


class Collection(object):
_client = None

def __init__(self, base_url):
self.base_url = base_url

# If no base url was specified, raise an exception
if not self.base_url:
raise Exception("No base_url specified")

self._client = Client(base_url)

def collectionName(self, collection):
args = Args()
args.setMemoryPointer("collection", collection)
return self._client.invokeMethod("collection_getCollectionName", args)

def allCollection(self, database, scopeName):
args = Args()
args.setMemoryPointer("database", database)
args.setString("scopeName", scopeName)
return self._client.invokeMethod("collection_collectionNames", args)

def documentCount(self, collection):
args = Args()
args.setMemoryPointer("collection", collection)
return self._client.invokeMethod("collection_documentCount", args)

def saveDocument(self, collection, document):
args = Args()
args.setMemoryPointer("collection", collection)
args.setMemoryPointer("document", document)
return self._client.invokeMethod("collection_saveDocument", args)

def collectionScope(self, collection):
args = Args()
args.setMemoryPointer("collection", collection)
return self._client.invokeMethod("collection_collectionScope", args)

def getDocument(self, collection, docId):
args = Args()
args.setString("docId", docId)
args.setMemoryPointer("collection", collection)
return self._client.invokeMethod("collection_getDocument", args)

def deleteDocument(self, collection, doc):
args = Args()
args.setMemoryPointer("collection", collection)
args.setMemoryPointer("document", doc)
return self._client.invokeMethod("collection_deleteDocument", args)

def purgeDocument(self, collection, doc):
args = Args()
args.setMemoryPointer("collection", collection)
args.setMemoryPointer("document", doc)
return self._client.invokeMethod("collection_purgeDocument", args)

def purgeDocumentById(self, collection, docId):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("docId", docId)
return self._client.invokeMethod("collection_purgeDocumentID", args)

def getDocumentExpiration(self, collection, docId):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("docId", docId)
return self._client.invokeMethod("collection_getDocumentExpiration", args)

def setDocumentExpiration(self, collection, docId, expirationTime):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("docId", docId)
args.setInt("expiration", expirationTime)
return self._client.invokeMethod("collection_setDocumentExpiration", args)

def getMutableDocument(self, collection, docId):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("docId", docId)
return self._client.invokeMethod("collection_getMutableDocument", args)

def createValueIndex(self, collection, name, expression):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("name", name)
args.setString("expression", expression)
return self._client.invokeMethod("collection_createValueIndex", args)

def iosCreateValueIndex(self, collection, name, expression):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("name", name)
args.setArray("expression", expression)
return self._client.invokeMethod("collection_createValueIndex", args)

def deleteIndex(self, collection, name):
args = Args()
args.setMemoryPointer("collection", collection)
args.setString("name", name)
return self._client.invokeMethod("collection_deleteIndex", args)

def getIndexNames(self, collection):
args = Args()
args.setMemoryPointer("collection", collection)
return self._client.invokeMethod("collection_getIndexNames", args)

def collectionSaveDocuments(self, database, documents, collection):
args = Args()
args.setMemoryPointer("database", database)
args.setMemoryPointer("collection", collection)
args.setDictionary("documents", documents)
return self._client.invokeMethod("collection_saveDocuments", args)
46 changes: 44 additions & 2 deletions CBLClient/Database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import uuid

from CBLClient.Client import Client
from CBLClient.Collection import Collection
from CBLClient.Args import Args
from keywords.utils import log_info
from keywords import types
Expand All @@ -21,6 +22,7 @@ def __init__(self, base_url):
raise Exception("No base_url specified")

self._client = Client(base_url)
self._collection = Collection(base_url)

def configure(self, directory=None, conflictResolver=None, password=None):
args = Args()
Expand Down Expand Up @@ -208,7 +210,7 @@ def deleteDocumentWithConcurrency(self, database, document, concurrencyControlTy
args.setString("concurrencyControlType", concurrencyControlType)
return self._client.invokeMethod("database_deleteWithConcurrency", args)

def create_bulk_docs(self, number, id_prefix, db, channels=None, generator=None, attachments_generator=None, id_start_num=0, attachment_file_list=None):
def create_bulk_docs(self, number, id_prefix, db, channels=None, generator=None, attachments_generator=None, id_start_num=0, attachment_file_list=None, collection=None):
"""
if id_prefix == None, generate a uuid for each doc

Expand Down Expand Up @@ -250,7 +252,10 @@ def create_bulk_docs(self, number, id_prefix, db, channels=None, generator=None,

doc_body["id"] = doc_id
added_docs[doc_id] = doc_body
self.saveDocuments(db, added_docs)
if collection:
self._collection.collectionSaveDocuments(db, added_docs, collection)
else:
self.saveDocuments(db, added_docs)
return list(added_docs.keys())

def delete_bulk_docs(self, database, doc_ids=[]):
Expand Down Expand Up @@ -385,3 +390,40 @@ def update_bulk_docs_by_deleting_blobs(self, database, doc_ids=[]):
del doc_body["_attachments"]
updated_docs[doc] = doc_body
self.updateDocuments(database, updated_docs)

def defaultScope(self, database):
args = Args()
args.setMemoryPointer("database", database)
return self._client.invokeMethod("scope_defaultScope", args)

def defaultCollection(self, database):
args = Args()
args.setMemoryPointer("database", database)
return self._client.invokeMethod("collection_defaultCollection", args)

def createCollection(self, database, collectionName, scopeName):
args = Args()
args.setString("collectionName", collectionName)
args.setString("scopeName", scopeName)
args.setMemoryPointer("database", database)
return self._client.invokeMethod("collection_createCollection", args)

def deleteCollection(self, database, collectionName, scopeName):
args = Args()
args.setString("collectionName", collectionName)
args.setString("scopeName", scopeName)
args.setMemoryPointer("database", database)
return self._client.invokeMethod("collection_deleteCollection", args)

def collectionsInScope(self, database, scopeName):
args = Args()
args.setString("scopeName", scopeName)
args.setMemoryPointer("database", database)
return self._client.invokeMethod("collection_collectionNames", args)

def collectionObject(self, database, collectionName, scopeName):
args = Args()
args.setString("collectionName", collectionName)
args.setString("scopeName", scopeName)
args.setMemoryPointer("database", database)
return self._client.invokeMethod("collection_collection", args)
2 changes: 1 addition & 1 deletion CBLClient/Replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def yield_for_replicator_connected(self, repl, max_times=5, sleep_time=0.5):
def wait_until_replicator_idle(self, repl, err_check=True, max_times=150, sleep_time=2, max_timeout=600):
count = 0
idle_count = 0
max_idle_count = 3
max_idle_count = 20

# Load the current replicator config to decide retry strategy
repl_config = self.getConfig(repl)
Expand Down
26 changes: 26 additions & 0 deletions CBLClient/Scope.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from CBLClient.Client import Client
from CBLClient.Args import Args


class Scope(object):
_client = None

def __init__(self, base_url):
self.base_url = base_url

# If no base url was specified, raise an exception
if not self.base_url:
raise Exception("No base_url specified")

self._client = Client(base_url)

def scopeName(self, scope):
args = Args()
args.setMemoryPointer("scope", scope)
return self._client.invokeMethod("scope_scopeName", args)

def collection(self, scope, collectionName):
args = Args()
args.setMemoryPointer("scope", scope)
args.setString("collectionName", collectionName)
return self._client.invokeMethod("scope_collectionObject", args)
2 changes: 1 addition & 1 deletion keywords/ChangesTracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def start(self, timeout=1000, heartbeat=None, request_timeout=None):
else:
request_timeout = 1000

auth_type = get_auth_type(self.auth)
auth_type, self.auth = get_auth_type(self.auth)
current_seq_num = 0

start = time.time()
Expand Down
Loading